samagotchi 0.163.0 → 0.165.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +77 -1
- data/docs/architecture.md +7 -5
- data/docs/bundles.md +4 -2
- data/docs/cli.md +23 -11
- data/docs/configuration.md +5 -1
- data/docs/guardrails.md +13 -16
- data/docs/internals/block-renderers.md +3 -1
- data/docs/internals/bridge.md +4 -3
- data/docs/internals/bundles.md +4 -2
- data/docs/internals/inline-widgets.md +13 -3
- data/docs/internals/remote-sessions.md +7 -2
- data/docs/internals/web-frontend.md +36 -9
- data/docs/memory.md +12 -7
- data/docs/plugins.md +6 -4
- data/docs/releasing.md +6 -2
- data/docs/scheduling.md +25 -3
- data/docs/sessions.md +9 -6
- data/docs/sub-agent.md +11 -0
- data/docs/testing.md +28 -4
- data/lib/samagotchi/block_renderers.rb +14 -7
- data/lib/samagotchi/bridge/card_store.rb +2 -1
- data/lib/samagotchi/bridge/turn_accumulator.rb +7 -8
- data/lib/samagotchi/bridge.rb +45 -3
- data/lib/samagotchi/bundle_command/installed_check.rb +2 -1
- data/lib/samagotchi/bundles/inline-widgets/manifest.yml +2 -2
- data/lib/samagotchi/bundles/inline-widgets/plugin.rb +8 -4
- data/lib/samagotchi/bundles/system/manifest.yml +1 -1
- data/lib/samagotchi/chi_home.rb +44 -2
- data/lib/samagotchi/cli/parent_wait.rb +5 -1
- data/lib/samagotchi/client_id.rb +34 -3
- data/lib/samagotchi/compat.rb +36 -0
- data/lib/samagotchi/context_command.rb +3 -0
- data/lib/samagotchi/context_providers.rb +5 -6
- data/lib/samagotchi/context_sources.rb +2 -2
- data/lib/samagotchi/continue_intent.rb +93 -0
- data/lib/samagotchi/events.rb +4 -4
- data/lib/samagotchi/extension_load.rb +2 -1
- data/lib/samagotchi/guardrails/child_boundary.rb +7 -27
- data/lib/samagotchi/guardrails/rules.rb +11 -9
- data/lib/samagotchi/guardrails/targets.rb +3 -4
- data/lib/samagotchi/inline_widgets.rb +16 -1
- data/lib/samagotchi/memory_bundle/provenance.rb +46 -4
- data/lib/samagotchi/memory_bundle/status.rb +2 -1
- data/lib/samagotchi/memory_command.rb +3 -0
- data/lib/samagotchi/memory_orphans.rb +4 -7
- data/lib/samagotchi/memory_paths.rb +64 -7
- data/lib/samagotchi/memory_usage.rb +1 -1
- data/lib/samagotchi/message_parts.rb +13 -0
- data/lib/samagotchi/note_command.rb +3 -6
- data/lib/samagotchi/parent_report.rb +3 -2
- data/lib/samagotchi/plugin/sessions.rb +4 -2
- data/lib/samagotchi/project_command.rb +4 -1
- data/lib/samagotchi/project_id_clash.rb +37 -26
- data/lib/samagotchi/project_init.rb +24 -7
- data/lib/samagotchi/reply_wait/poll.rb +2 -1
- data/lib/samagotchi/schedules.rb +124 -106
- data/lib/samagotchi/send_command/parent_gate.rb +8 -5
- data/lib/samagotchi/send_command.rb +203 -45
- data/lib/samagotchi/session.rb +3 -2
- data/lib/samagotchi/session_access/local.rb +25 -2
- data/lib/samagotchi/session_access/remote.rb +40 -4
- data/lib/samagotchi/session_chain/links.rb +109 -0
- data/lib/samagotchi/session_chain.rb +7 -19
- data/lib/samagotchi/session_continue.rb +143 -57
- data/lib/samagotchi/session_inbox_delivery.rb +94 -28
- data/lib/samagotchi/session_manager/delivery.rb +106 -18
- data/lib/samagotchi/session_manager/removal.rb +13 -7
- data/lib/samagotchi/session_manager.rb +1 -0
- data/lib/samagotchi/session_retention.rb +20 -10
- data/lib/samagotchi/session_setup.rb +31 -1
- data/lib/samagotchi/state_format.rb +12 -8
- data/lib/samagotchi/terminal_ui/attach_launcher.rb +6 -7
- data/lib/samagotchi/terminal_ui.rb +20 -9
- data/lib/samagotchi/tools/delegate.rb +2 -1
- data/lib/samagotchi/verify_fresh.rb +4 -1
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/message_display.rb +1 -9
- data/lib/samagotchi/web/public/activity.js +2 -2
- data/lib/samagotchi/web/public/app.js +13 -13
- data/lib/samagotchi/web/public/apple-touch-icon.png +0 -0
- data/lib/samagotchi/web/public/bar_fold.js +293 -0
- data/lib/samagotchi/web/public/card.js +1 -1
- data/lib/samagotchi/web/public/composer_mode.js +5 -7
- data/lib/samagotchi/web/public/favicon.svg +1 -1
- data/lib/samagotchi/web/public/icons/chi-180.png +0 -0
- data/lib/samagotchi/web/public/icons/chi-192.png +0 -0
- data/lib/samagotchi/web/public/icons/chi-512.png +0 -0
- data/lib/samagotchi/web/public/index.html +132 -65
- data/lib/samagotchi/web/public/info_bar.js +28 -16
- data/lib/samagotchi/web/public/info_bar_model.js +70 -1
- data/lib/samagotchi/web/public/inline_widgets.js +4 -1
- data/lib/samagotchi/web/public/more_sheet.js +98 -40
- data/lib/samagotchi/web/public/stage_view.js +3 -1
- data/lib/samagotchi/web/public/stream_handlers.js +1 -1
- data/lib/samagotchi/web/public/turn_events.js +0 -122
- data/lib/samagotchi/web/public/turn_model.js +1 -1
- data/lib/samagotchi/web/public/widget_picks.js +18 -3
- data/lib/samagotchi/web/public/widget_walk.js +14 -4
- data/lib/samagotchi/web/session_access_routes.rb +8 -1
- data/lib/samagotchi/web/session_control.rb +15 -2
- data/lib/samagotchi/web/session_create.rb +4 -2
- data/lib/samagotchi/web/update_check.rb +27 -8
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 19bcc79b84235269c1a5b70df00874349dfd3e921f4876651c10501f5b5cc028
|
|
4
|
+
data.tar.gz: f444020ead2aecdf956789f91e6023dccc70c228a9e9e4b44f295407cbf77e82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca8fba36e7e40ed78f95d26eb3395488f965de7ed2804729856ce885ea64f532c387ef13603db4c85e60a8e91e847751b1a0bb334ac21c2defbfcec332517f72
|
|
7
|
+
data.tar.gz: 5bc94f69e9c5deae6cae9309592f3d72e3fe8402c4340f86358df83be31d51be4a3532bb44bd86212d35e5c3dc8a7321fcbc4c0a5700b9b20828b4de93a5459d
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,80 @@ and commands may change between minor versions. How releases are made:
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.165.0] - 2026-11-11
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Guardrails: `tool: shell` rules and child boundaries also match plugin tools whose `targets:` declare a command,
|
|
16
|
+
so a plugin's read-only command in another checkout no longer asks.
|
|
17
|
+
- web: the session bar is one row at every window width. What doesn't fit folds into `⋯` by priority, lowest first
|
|
18
|
+
(the folder and 🧰 first, then the notes, set and participants, the model, the clock…); `⋯` is on the row everywhere,
|
|
19
|
+
with a count of what it holds on a desktop and its dot when a folded item asks for a look. Archive and delete live in
|
|
20
|
+
`⋯` alone. A chain whose earlier links a schedule pruned now says so on the bar (`↩ earlier links pruned`).
|
|
21
|
+
- A session you stopped or archived stays that way for senders other than you: a schedule's firing, a plugin's
|
|
22
|
+
`sessions.send`, a `delegate` follow-up and a participant's turn start an idle session as before, but no longer
|
|
23
|
+
un-stop or un-archive one (`the session is stopped; only its owner's message starts it again`). `chi send`, a web tab
|
|
24
|
+
and a terminal still do.
|
|
25
|
+
- chi web on a phone: a session's panel runs edge to edge, tap targets are about 40px, the brand in a session is a
|
|
26
|
+
round `+` (new session), and an answer's copy button floats so the first line wraps short of it. Inline code's side
|
|
27
|
+
padding is 3px at every width.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- chi web on touch: Revise no longer looks disabled.
|
|
32
|
+
- chi web: an answered card that ends exactly at its line's edge brings the line back.
|
|
33
|
+
- chi web: a `/command` from a client that names no sender is recorded as `web:unnamed` instead of as you.
|
|
34
|
+
- The retention sweep's skeleton-folder prune reads the folder again under the session's lock, so a session file
|
|
35
|
+
or content written between its check and its removal is kept instead of deleted.
|
|
36
|
+
- A worker's `GET /session/:id/state` reply is read under the event lock, so its `event_id` always matches its state.
|
|
37
|
+
- A Verify fresh child now keeps its session's own `parent_answers` (`--parent-answers`, `/parent-answers`), as a
|
|
38
|
+
`delegate` child does, instead of falling back to config.yml's.
|
|
39
|
+
- A schedule no longer restarts a session you stopped: it skips it (`the session is stopped; …`), in both modes, and a
|
|
40
|
+
stop that lands just before a firing counts as a skip, not a failure.
|
|
41
|
+
- Project marker ids no longer reuse another project's memory folder; `chi project init --new-id` gives it a safe id.
|
|
42
|
+
- A schedule that comes due while you are continuing its session (`chi send --new --continues`, web `continue →`) is
|
|
43
|
+
skipped for that tick (`being continued as 7b2d41aa; retry at the next tick`) instead of failing as `archived`, so
|
|
44
|
+
the race no longer counts toward `max_failures`. A chain you archived yourself still fails its schedules.
|
|
45
|
+
- A context source from a bundle whose script is gone, or that its install record has no sha256 for, now says so
|
|
46
|
+
(`scripts/pr.rb is missing (reinstall the bundle)`) instead of claiming the script "differs from the installed one".
|
|
47
|
+
- A chain schedule whose session was archived between the tick's check and its firing now fails as `archived`, as the
|
|
48
|
+
check says, instead of `the chain is gone`.
|
|
49
|
+
- web: a ```` ```chi-ui ```` picks row whose id starts with `!` or `/` no longer makes **Fill reply** start a shell
|
|
50
|
+
line or a session command: the leading `!` and `/` are dropped from the id (`!touch x` reads `touch x: …`), and an id
|
|
51
|
+
of nothing else refuses the block.
|
|
52
|
+
- `chi send` to a continued session no longer brings the old link back beside the new one when the continue finishes
|
|
53
|
+
just as the send goes in: it resends to the new link (or says `refused: being continued; send again in a moment`
|
|
54
|
+
after 10 s), and a same-mode schedule firing at that moment queues its turn in the new link instead of failing as
|
|
55
|
+
`archived`. With `--remote`, the other machine's chi web needs this release for the send half.
|
|
56
|
+
- `chi send OLD NEW` no longer sends twice when a continue makes NEW out of OLD just as the send goes in, and a send
|
|
57
|
+
with `--image` that resends that way no longer leaves its images copied into the old link (on this machine).
|
|
58
|
+
|
|
59
|
+
Update with `chi update`, then restart chi web and running sessions (`chi sessions restart`).
|
|
60
|
+
|
|
61
|
+
## [0.164.0] - 2026-11-10
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- `chi send` to a session that was continued goes to the newest link of its chain, as `chi note` does, and the old
|
|
66
|
+
link stays archived (it used to come back beside the new one): `3f9a1c2e → 7b2d41aa (continued) sent`. So a
|
|
67
|
+
chain's first id keeps working as its address. `--wait --format json` reports the link it waited on as `session_id`
|
|
68
|
+
and the id you gave as `asked`. A send while the continue is still running waits a moment for the new link. With
|
|
69
|
+
`--remote`, the other machine's chi web needs this release too; an older one sends to the id named, as before.
|
|
70
|
+
- chi web has a new icon: a white brushed χ on the same dark tile (tab, Home Screen app, notifications). An iOS
|
|
71
|
+
Home Screen app keeps the old icon until you remove it and add it again.
|
|
72
|
+
|
|
73
|
+
### Fixed
|
|
74
|
+
|
|
75
|
+
- A review session (`chi review`) no longer teaches the model the `chi-ui` picks and walk widgets: its participants'
|
|
76
|
+
page doesn't draw them, so they read raw YAML. The owner's working sessions, paired ones too, keep them.
|
|
77
|
+
(inline-widgets 0.1.1)
|
|
78
|
+
- chi web behind an auth proxy: when the proxy answered the widgets' stylesheet with its login page, `chi-ui` widgets
|
|
79
|
+
stayed unstyled until a reload; the next widget drawn now fetches the stylesheet again.
|
|
80
|
+
- chi web: a `chi-ui` walk step whose only cases loop back (a retry from an earlier step) no longer hides Next, so
|
|
81
|
+
the walk can go on past it.
|
|
82
|
+
|
|
83
|
+
Update with `chi update` (it upgrades inline-widgets to 0.1.1), then restart chi web.
|
|
84
|
+
|
|
11
85
|
## [0.163.0] - 2026-11-10
|
|
12
86
|
|
|
13
87
|
### Added
|
|
@@ -6044,7 +6118,9 @@ and long-lived sessions.
|
|
|
6044
6118
|
- A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
|
|
6045
6119
|
hotkey panel that send selected text or the clipboard to your sessions.
|
|
6046
6120
|
|
|
6047
|
-
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.
|
|
6121
|
+
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.165.0...HEAD
|
|
6122
|
+
[0.165.0]: https://github.com/dm1try/samagotchi/compare/v0.164.0...v0.165.0
|
|
6123
|
+
[0.164.0]: https://github.com/dm1try/samagotchi/compare/v0.163.0...v0.164.0
|
|
6048
6124
|
[0.163.0]: https://github.com/dm1try/samagotchi/compare/v0.162.0...v0.163.0
|
|
6049
6125
|
[0.162.0]: https://github.com/dm1try/samagotchi/compare/v0.161.0...v0.162.0
|
|
6050
6126
|
[0.161.0]: https://github.com/dm1try/samagotchi/compare/v0.160.0...v0.161.0
|
data/docs/architecture.md
CHANGED
|
@@ -199,7 +199,7 @@ log's last 4 MB). Rows: [configuration.md](configuration.md#checking-it-chi-home
|
|
|
199
199
|
- **Starting:** every spawn marks the session starting (`<uuid>/starting`, `{pid, at}`, `StartingMarker`) until its worker holds the lock: `spawn_worker_for_session` writes it with its own pid before `Process.spawn` and the starter's after (the starter lives until the worker holds the lock, at most `WORKER_START_GRACE`; a spawn that raises or whose starter is gone leaves none), `spawn_session` before the new file is saved, and `Worker#start` removes it. It holds for 60 s at most, and only while the pid it names runs. A resume claims it (`StartingMarker.claim`, a link(2): of resumes racing from any processes one wins), then reads the owner again. A stop marker cancels the hold-off (`start_pending?` = starting and not stop-marked) for a start marked before the stop only: of two sends after a stop, the claim lets one spawn. The stop marker carries its own `at` (`{"at"}`, on the starting marker's clock; `Session.stopped_at`), an older chi's empty one its mtime. The sweep, archive (`:starting`) and delete (refused as an owned session) honour it. N-1: an older spawner writes none for a resume (the owner checks stay); an older worker never leaves one it was given (every worker clears it at start); a leftover one is stale by age or pid (a claim's temp files a kill left, `starting.*`, count as skeleton); a 0.160 spawner or chi web still holds off on a fresh marker under a stop (it reads `starting?` before the stop), until the start ends or 60 s. `SessionManager` keeps only its starters' pids, for chi web's restart to adopt (`live_spawn_pids`), and decides nothing from them.
|
|
200
200
|
- **Deleting:** `delete_session`, the retention sweep and a failed continue's cleanup use `remove_files` for the session JSON, sidecar dir, plugin state, attached context, participant grants, System 1 runs and context-candidate records. The JSON and dir go through `remove_session_files`, holding the owner lock (kind `deleting`, which `stop_session` never signals; not waited for: a worker that took it since the check keeps the session) and reading the starting marker again under it (a resume that claimed the start just before keeps the session; one after it sees the lock held). N-1: an older chi's stop reading the owner then would TERM the deleter (chi web, the CLI) in that moment; an older reader shows the kind as unknown. `Session#save` of a session read from its file (or saved once) skips a file that is gone (log `save_skipped_deleted`) rather than recreate it; only a new session's first save creates one.
|
|
201
201
|
- **Worker presence:** whether a worker is up, coming or held off is read once per decision as a `WorkerPresence` (`worker_presence.rb`, a `Data.define`), the deciders' one reader of those facts (display and list rows still read `session_owner` / `WorkerLink` themselves): the owner lock's holder, the stop marker (`stop_marked?`: the only "stopped" a decider reads, never the session file's status), the `starting` marker (`StartingMarker`, `starting?`, `start_pending?`: every spawn writes it, see Starting), the archive marker, the session file's existence, and the `WorkerLink` outcome when asked (never the file itself: a scratch session's flag is read by `WakePolicy`, last). The deciders read it: `resume_session` (tui, owned, `resume_held_off?`), the session inbox's `WakePolicy` (a ring, a push's wake, a note, a fresh verdict, `wake_for_report`, `deliver_turn`'s two liveness checks, `WorkerBoot`'s leave: below), `Local#wake`/`#worker`, `AttachLauncher`, `Schedules#busy_reason`, archive, delete and the retention sweep. Each keeps its own subset of the facts and their order.
|
|
202
|
-
- **Session inbox:** a delivery into a session (`SessionInbox.deliver(kind, id) { |at| write }`, `session_inbox_delivery.rb`) runs one path: resolve the link (`SessionInbox::Head.resolve`:
|
|
202
|
+
- **Session inbox:** a delivery into a session (`SessionInbox.deliver(kind, id) { |at| write }`, `session_inbox_delivery.rb`) runs one path: resolve the link (`SessionInbox::Head.resolve`: push and a fresh verdict are pinned to the id named; a send and a note go to the chain's newest link, and for a send (a kind that starts an archived link) a continue of the reached link in flight (`ContinueIntent.in_flight`: `continue.json` written, `continue.lock` held, the successor not saved yet) gives `:continuing` with the successor's id, which chi send asks again for a moment and then refuses; a note needs no such check (`NoteMove` moves or adopts it); a ring's file stays with the parent `parent.json` names and its wake goes one hop, to the link whose `ChildReports` reads that file; only an archived id is walked, with one `Session.list`: `SessionChain::Links#first_live`), refuse before any write (a gone session; a one-turn run's or a scratch session for send and a note), write with the kind's own writer (formats unchanged), read `WorkerPresence` once, and apply the kind's `WakePolicy` row. `decide` reads in one order for every kind: gone, one-turn run (`:owned`), owned (`:live`), the stop marker (`:stopped`: the only "stopped", the file's status never decides; send un-stops), archived (send alone starts one), starting (`:starting`, never a second spawn), the kind never starts (`:none`: a note, a fresh verdict) or wasn't asked to (`:off`), scratch (the session file is read only here), else `:start` through `SessionManager.start_for_inbox` (`resume_session`, its claim on the starting marker; it answers `:woken` only when it spawned the worker, `:starting` when another start won the claim, `:live` when a worker took the lock since). N-1 gap: a session file that says `stopped` with no stop marker (stopped before the marker existed, or a resume whose spawn failed after it cleared the marker) is woken, and an older worker, which has no `Worker#settle_stale_status`, exits on its first pass; the wake still reads `:woken`, and each later ring or push spawns another such worker (bounded by the rings and pushes). Restarting chi on the new version (`chi web`, the workers) closes it. `SessionInbox.wake` is the wake half alone (`wake_for_report`, a failed continue's rings). On it: `ChildRing.ring` (its start on a thread), `Local#context_push`'s wake (its outcome is `ContextPush#wake`, the push line's ending), `NoteDelivery.deliver` (every note writer a person or another session drives: `chi note`, `send_note`, `chi broadcast`, chi web's notes route; `NoteDelivery::Result#id` is the link that has it, `#asked` the one named; `/objectives` passes `pin: true`: its list is its own session's) and `VerifyFresh.forward` (`:fresh_verdict`: the child's parent, pinned, no worker). Send keeps its Bridge/file flow in `SessionManager.deliver_turn`, which resolves nothing (it acts on the id it is given: an archived link gets the message and comes back); chi send resolves the head first (`SessionAccess#head`, remotely `GET /api/sessions/resolve?head=1`), while the web composer, a participant's turn, `delegate` follow-ups, `Plugin::Sessions` and `Schedules` stay on the id they name; its two liveness checks (before the post, after a file's write) read the sender's row (`WakePolicy.for_sender(client_id)`, `ClientId.wake_kind`: a person's — chi send, a web tab, a TUI — is `:send`; a schedule, a plugin, a delegate follow-up and a participant have rows of their own, any other id `:automatic`, which start an idle session but neither un-stop nor start an archived link: refused before the write, `DeliverResult::STOPPED` / `ARCHIVED`) and leave the other refusals to `resume_session`'s wording. One row is not a delivery: `:leave`, `WorkerBoot.run_session_loop`'s successor as a worker leaves (input left after a signal, an idle exit's or `/exit`'s input or rings, a restart), read on a fresh presence once the lock is free: a stop that landed as it left starts none for any way out (`resume_session` would clear the stop; logged `respawn_dropped`, `restart_dropped` for a restart, whose reminders go with it), the input and rings stay for the next start. The notes a spawn writes into the session it starts stay direct `SessionInbox.write_note` calls, pinned by construction: spawn_session's chain note, `ContextMove`'s notes, `Objectives.carry`, `ChildMove`'s note to a moved child. A continue moves the previous link's waiting notes to the new link last in its `before_spawn` (`NoteMove.move`), a failed one gives them back before the link goes (`NoteMove.give_back`), and the new link's worker adopts what the archived links before it get after their continue (`NoteMove.adoption`, from `WorkerInbound#absorb_notes` and `Worker#start`: back along the chain through up to 8 archived links, from each only notes from the creation of the link that continued it, never an objectives list). `write_note` refuses a session with no file and no folder (`Session::NotFound`), so a late writer can't bring back a deleted link's folder.
|
|
203
203
|
- **Retention:** 14 days / 500 cap (env `SAMAGOTCHI_SESSION_RETENTION_DAYS`/`MAX_COUNT`, optional `KEEP_STATUS`), live-owner and starting guard (looked at again right before a session's files go), only when `*.json` present; lazy sweep at most once per `session.sweep_interval_hours` (default 24) from the session hub's full-probe tick (and on `GET /api/sessions`, which the page no longer calls), manual via `bin/chi sessions prune --dry-run`.
|
|
204
204
|
- **Ordering:** `Session.list(sort:,order:,limit:,offset:)` and `GET /api/sessions?sort=&order=&limit=&offset=` default `updated_at desc`; Web UI sort/filter/pagination.
|
|
205
205
|
- **Test hygiene:** `test_run` flag when `SAMAGOTCHI_ENV=test`/`RACK_ENV=test`/`CI`, targetable via `prune --test-only` / `clean`.
|
|
@@ -351,7 +351,9 @@ first RubyGems check is about 30 seconds after chi web starts, then it checks at
|
|
|
351
351
|
intervals. A stable release is available only after `update.min_age_hours` and when newer than both
|
|
352
352
|
the running and newest installed chi. Its atomic, mode-0600
|
|
353
353
|
`$XDG_STATE_HOME/samagotchi/update_check.json` keeps the check cooldown and versions already
|
|
354
|
-
announced across restarts, and AutoUpdate's record (`auto`, `auto_failed`; `save_auto`)
|
|
354
|
+
announced across restarts, and AutoUpdate's record (`auto`, `auto_failed`; `save_auto`); its `version` is its
|
|
355
|
+
`StateFormat` (`UpdateCheck::STATE_FORMAT`: a file without one is an older chi's, a newer chi's keeps its version and
|
|
356
|
+
unknown keys through a write). `update.notify: off`
|
|
355
357
|
with `update.auto: off` starts no checker thread and makes no network request. `update_blocked` names why the local gem cannot be updated in place (checkout, Bundler, or
|
|
356
358
|
an unwritable gem directory). The page tells the owner to run `chi update`; a newer `installed`
|
|
357
359
|
version than the server itself still means restart chi web (its workers already run the newest chi,
|
|
@@ -624,7 +626,7 @@ A map of the parts the overview above doesn't name (paths under `lib/samagotchi/
|
|
|
624
626
|
| Paths | `paths.rb` (`Paths`) | The XDG base dirs chi's files live under, read from the env on every call: `Paths.state_home` (`$XDG_STATE_HOME`, else `~/.local/state`) and `Paths.config_home` (`$XDG_CONFIG_HOME`, else `~/.config`), both defaults under `Dir.home`; a blank variable counts as unset, a relative one is made absolute from the current directory. `Paths.tilde` shows a path with `~` for the home folder. `SessionManager` hands a spawned worker the spawner's `XDG_STATE_HOME` / `XDG_CONFIG_HOME`, when set, made absolute, so a relative one isn't read from the session's folder. |
|
|
625
627
|
| MemoryBundle | `memory_bundle.rb`, `memory_bundle/{installer,builder,installed_bundle,plugin_ref,bundle_hook}.rb` (`Installer`, `Builder`, `InstalledBundle`, `PluginRef`, `BundleHook`) | Installing, building and reading bundles of memories, rules, plugins and scripts (`BundleHook`: an older record's retired class-file hook). |
|
|
626
628
|
| Bundle authoring | `bundle_command.rb` (`BundleCommand`), `bundle_command/{scaffold,check,test_run}.rb`, `bundle_command/try/{run,sandbox,trace}.rb`, `testing.rb` + `testing/` (the test kit) | `chi bundle new`, `check`, `test` and `try`, and the kit a bundle's tests load it with ([bundle-authoring.md](bundle-authoring.md), [internals/bundles.md](internals/bundles.md)). |
|
|
627
|
-
| Session file | `session.rb` (`Session`, `Session::FIELDS`), `session_field.rb` (`SessionField`), `session_paths.rb` (`SessionPaths`), `session_setup.rb` (`SessionSetup`) | A session's `<uuid>.json`: one `SessionField` row per key (default, cast, what the file gets; the codec on its type), from which `Session.new`, `.from_h` and `#to_h` are built; `SessionPaths` is where the file and the session's dir are and the id rule, a leaf `Session` extends (so `ArchiveStore`, `ContextSources` and `ParticipantMode` name no `Session` constant; the first two still require session.rb at load, `ParticipantMode` lazily); `SessionSetup` the settings a fork and a continue carry, applied by member name. See [sessions.md](sessions.md#session-file). |
|
|
629
|
+
| Session file | `session.rb` (`Session`, `Session::FIELDS`), `session_field.rb` (`SessionField`), `session_paths.rb` (`SessionPaths`), `session_setup.rb` (`SessionSetup`) | A session's `<uuid>.json`: one `SessionField` row per key (default, cast, what the file gets; the codec on its type), from which `Session.new`, `.from_h` and `#to_h` are built; `SessionPaths` is where the file and the session's dir are and the id rule, a leaf `Session` extends (so `ArchiveStore`, `ContextSources` and `ParticipantMode` name no `Session` constant; the first two still require session.rb at load, `ParticipantMode` lazily); `SessionSetup` the settings a fork and a continue carry (`.of`), applied by member name; every new-session request (chi's run flags, the one-shot, `chi send --new`, chi web's create) builds its setup with `SessionSetup.from_request`, and `spec/session_setup_entrypoints_spec.rb` holds each entrypoint's cell for each member. See [sessions.md](sessions.md#session-file). |
|
|
628
630
|
| Session config (`--set`) | `session_config.rb` (`SessionConfig`, `SessionConfig::Settings`) | A session's own settings as one value (`Session#settings`, `SessionSetup#settings`): `core`, the `--set KEY=VALUE` values of the core keys marked `session: true` (`Config::Entry`), typed by `Config.coerce!` and read first through `Config.get(key, session:)` (`RecapSetup`; `Engine#session=` rebuilds the recap job, `IdleScheduler#replace_job`), file key `config_settings`; `bundles`, the `--set BUNDLE.KEY=VALUE` values, checked against the manifest's `session_settings:`, laid over `bundles: <name>:` in `ctx.settings` ([plugins.md](plugins.md)), file key `bundle_settings`. `SessionConfig.clash` refuses a bundle setting named like a core one (install, `chi bundle check`). See [configuration.md](configuration.md#per-session-settings). |
|
|
629
631
|
| Plugin API | `plugin/api.rb` (`Plugin::Api`), `plugin/tool_spec.rb` (`Plugin::ToolSpec`: a checked tool declaration, how it is registered), `plugin/loader.rb`, `plugin/context.rb` (`ctx`), `plugin/http.rb` + `plugin/http_transport.rb` (`ctx.http`), `plugin/card.rb` (`Plugin::Card`) | What a bundle's plugin registers: tools, commands, annotation actions, hooks, services, toolkits, peer sources; what its handlers get as `ctx` ([plugins.md](plugins.md)). |
|
|
630
632
|
| Peer bundles' base | `plugin/peer.rb` (`Plugin::Peer`) | What claude-peer and codex-peer share (the send tool, the command, the cards, payloads); each bundle's subclass sets its strings and transport ([bundles.md](bundles.md#the-claude-peer-bundle)). |
|
|
@@ -639,7 +641,7 @@ A map of the parts the overview above doesn't name (paths under `lib/samagotchi/
|
|
|
639
641
|
| Idle work | `idle_scheduler.rb` (`IdleScheduler`), `idle_recap.rb` (`IdleRecap`), `idle_reminders.rb` | One poller for an idle session's recap and reminders. |
|
|
640
642
|
| Attached context | `context_sources.rb` (`ContextSources`), `context_poller.rb`, `context_absorber.rb`, `context_candidates.rb` (`ContextCandidates`: proposed sources, attached on the owner's mention at a turn's start, before the worker's absorb, or in a one-shot's turn; `owner_prompt.rb` decides whose words count), `peer_sources.rb` (`PeerSources`: the sources peer bundles declare) | External sources a session keeps fresh, and the peer loop's wakes ([context.md](context.md)). |
|
|
641
643
|
| LLM context strategies | `llm_context_strategy.rb`, `llm_context_view.rb`, `llm_context_stale.rb`, `llm_context_forget.rb` | What a request sends of the history (none, stale, forget) ([internals/llm-context-forget.md](internals/llm-context-forget.md)). |
|
|
642
|
-
| Session chains | `session_continue.rb` (`SessionContinue`), `session_chain.rb` (`SessionChain`) | A session that continues an earlier one. `SessionChain.opener_for` gives the text web `continue →` prefills in the new link: the previous link's own first typed message when that link continues one itself, else nil (the 201's `opener`; not saved) ([sessions.md](sessions.md)). |
|
|
644
|
+
| Session chains | `session_continue.rb` (`SessionContinue`), `session_chain.rb` (`SessionChain`), `session_chain/links.rb` (`SessionChain::Links`) | A session that continues an earlier one. `SessionChain::Links` is the one chain walker (one listing; `latest`, `first_live`, `root`, `next_of`): `SessionChain.latest`/`.next_of`, `SessionInbox::Head` and the schedule tick all ask it. `SessionChain.opener_for` gives the text web `continue →` prefills in the new link: the previous link's own first typed message when that link continues one itself, else nil (the 201's `opener`; not saved) ([sessions.md](sessions.md)). |
|
|
643
645
|
| Review sessions | `review_start.rb` (`ReviewStart`), `session_review.rb` (`SessionReview`, the session's `review` field), `review_command.rb` (`ReviewCommand`, `chi review`), `review_apply.rb` (`ReviewApply`) | A session made to be shared: idle, its subjects project files checked by `Guardrails::ReviewPaths`, a fork of a working session from its recap (`--from`); Apply quotes a participant's review turn into the owner's composer ([sessions.md](sessions.md#review-sessions), [internals/participants.md](internals/participants.md)). |
|
|
644
646
|
| chi web's routes | `web/app.rb` (`Web::App`: the gate, `ROUTES`, the shared helpers), `web/message_display.rb` (`Web::MessageDisplay`: saved messages and cards as display items, the owner show's stamped with their turns' drawings and carrying no parts (a step's ✂ marks only), the participant review's with their parts, `POST /api/render`), `web/session_show.rb` (`Web::SessionShow`: `GET /api/sessions/:id` with its `cards`, `tail` and `timing` re-reads, `GET …/output`, the timing payload), `web/session_create.rb` (`Web::SessionCreate`: `POST /api/sessions`, a continue, a review fork), `web/session_control.rb` (`Web::SessionControl`: answer, command, turn and images, cancel, stop, restart, archive, delete), `web/push_routes.rb` (`Web::PushRoutes`: `/api/push`, its subscriptions, prefs, test and presence), `web/block_renderer_routes.rb` (`Web::BlockRendererRoutes`: `GET /api/block_renderers` and one renderer's file, [internals/block-renderers.md](internals/block-renderers.md)), `web/reload_check_route.rb` (`Web::ReloadCheckRoute`: `POST /api/sessions/:id/reload_check`, the opt-in `web.reload_check`'s counts from the page's `reload_check.js`, 204 and one `reload_checked` log line, with `reload_mismatch`, its `kinds`, `excused` (ACCEPTED ids) and `explained` when the turn read otherwise after a reload; the worker's version is chi web's own view, its sidecar) | The handlers `App`'s `ROUTES` name, in the file that holds their kind; each mixin is included in `App` and reads its helpers and ivars, so `app.send(:handle_show, …)` and the specs that stub `App` methods work as before. |
|
|
645
647
|
| Web Push | `web/push.rb` (`Web::Push`: `Runtime`, `preflight!`, the `web.push.*` settings), `web/push/crypto.rb` (`Push::Crypto`: RFC 8291 aes128gcm, RFC 8292 VAPID), `web/push/store.rb` (`Push::Store`, `Store::Sub`: `web-push/vapid.pem`, `subscriptions.json`), `web/push/client.rb` (`Push::Client`, `Client::Result`), `web/push/attention.rb` (`Push::Attention`: notify.js's rules in Ruby, shared cases in `spec/fixtures/attention_cases.json`), `web/push/presence.rb` (`Push::Presence`: the pages' "in front" reports), `web/push/notifier.rb` (`Push::Notifier`, a hub subscriber with a sender thread), `web/push_routes.rb` (`Web::PushRoutes`), `private_files.rb` (`PrivateFiles`, shared with the grants), `public/sw.js`, `public/push.js`, `public/manifest.webmanifest` | chi web pushes what the tab notifies for (approvals, questions, step-limit questions, cards, failed turns; done turns to a device that asks) to the owner's Home Screen app over an https public URL: the Notifier turns the hub's new attentions into show pushes after a hold, unless a chi web page is in front, at most 30 an hour, with one retry and a restart catch-up (`sent.json`) (each carries the keys still open, and the badge; no close push: every push shows a notification); the bell (`notifications.js`) subscribes the device, and the service worker and the page close the answered ones. See [internals/web-push.md](internals/web-push.md). |
|
|
@@ -658,7 +660,7 @@ A map of the parts the overview above doesn't name (paths under `lib/samagotchi/
|
|
|
658
660
|
| Dialects | `llm/dialect.rb` (`LLM::Dialect`) | What an `api: anthropic` provider's `/v1/messages` does differently (`dialect: fireworks`) ([internals/anthropic.md](internals/anthropic.md)). |
|
|
659
661
|
| Logging | `log.rb` (`Log`), `log_subscriber.rb` (`LogSubscriber`), `log_path.rb` (`LogPath`), `log_line.rb` | The debug log: tagged records, a session's event trail, where the file goes ([configuration.md](configuration.md#debug-log-file)). |
|
|
660
662
|
| Stores | `reminder_store.rb` (`ReminderStore`), `recap_store.rb` (`RecapStore`) | A session's reminders, and its idle recap (`recap.json`). |
|
|
661
|
-
| Schedules | `schedules.rb` (`Schedules`, its `Entry`, `Tick
|
|
663
|
+
| Schedules | `schedules.rb` (`Schedules`, its `Entry`, `Tick`; the tick walks chains over one `SessionChain::Links`), `schedule_command.rb` (`ScheduleCommand`) | Durable schedules that outlive every worker: versioned `<state dir>/schedules.json` and its `schedules.lock`; rewrites preserve unknown keys and entries missing required members. The tick's busy check (a live worker asked over the Bridge's `GET /activity`, the files when there is none), the chain prune. `chi schedule` is this machine only. See [Scheduling](scheduling.md). |
|
|
662
664
|
| Reply waits | `reply_wait.rb` (`ReplyWait`, `GONE_AFTER`: the one dead-worker rule), `reply_wait/poll.rb` (`ReplyWait::Poll`, one look per poll), `reply_wait/target.rb` (`ReplyWait::Target`: which turn a wait binds, cursor, baseline, `owner_grace`; `first_message`, `message`, `wait_only`, `answer`, `participant`, `from_cursor`), `reply_wait/liveness.rb` (`ReplyWait::Liveness`: one owner and link read per look; `#owner?` for gone, `#worker_owned?` for an open question) | `chi send --wait`, `chi answer`, a participant's wait, the delegate tools and delegate reports wait through `ReplyWait.call(id, **target.to_h, …)` ([sub-agent.md](sub-agent.md)). |
|
|
663
665
|
| Session rows | `session_row.rb` (`SessionRow`) | A session as the lists see it: scalar facts only, built by `SessionManager.session_rows` (one owner, link, recap and analytics read each), `#to_summary_h` the summaries route's body and `.from_summary_h` a remote's rows read back, `#cli_line` the one `chi sessions list` line, `.running_or_starting?` the delegates' and Verify fresh's "running" (a 15 s grace for a worker on its way). A leaf: never session_manager or web. |
|
|
664
666
|
| Setup and update | `bootstrap_command.rb`, `bootstrap/`, `update_command.rb`, `gem_update.rb` | `chi bootstrap` (first config.yml, system bundle, core profile) and `chi update` (the gem, shipped bundles, the macOS helper). |
|
data/docs/bundles.md
CHANGED
|
@@ -1376,8 +1376,10 @@ this API (`lib/samagotchi/bundles/inline-widgets/plugin.rb`) and has no settings
|
|
|
1376
1376
|
choose from.
|
|
1377
1377
|
- **Where it draws**: chi web, in the answers. The terminal shows the block's YAML, and a block chi can't read stays
|
|
1378
1378
|
YAML with a short note under it.
|
|
1379
|
-
- **Where the prompt has none**: a delegate child (its parent reads the report, nobody sees it drawn)
|
|
1380
|
-
`chi -p … --non-interactive
|
|
1379
|
+
- **Where the prompt has none**: a delegate child (its parent reads the report, nobody sees it drawn), a one-shot
|
|
1380
|
+
`chi -p … --non-interactive`, and a review session (`chi review`: its participants' page draws no widgets, so they
|
|
1381
|
+
would read the YAML). A working session you pair in keeps them: your page draws them, and inviting someone later
|
|
1382
|
+
doesn't change the prompt. `/stats` lists the sections a session's prompt holds: `picks (inline-widgets), walk
|
|
1381
1383
|
(inline-widgets)`.
|
|
1382
1384
|
- **Cost**: about 2,900 characters in the stable part of the prompt, the same at every build, so the prompt cache keeps.
|
|
1383
1385
|
- **Uninstall**: `chi bundle uninstall inline-widgets` takes the sections out of new sessions' prompts (a session you
|
data/docs/cli.md
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
- `chi broadcast [-m TEXT] [--all] [--dry-run]`, `chi broadcast log [--last N] [--format json]`, `chi broadcast deliver BROADCAST_ID (ID|PREFIX)...` — share one piece of information (TEXT or stdin) with every session it may concern, as a context note from `broadcast` (see [Broadcast](broadcast.md))
|
|
23
23
|
- `chi context <add|push|ls|show|refresh|rm|mute|unmute> …` — attach live external text to sessions (a command chi runs every so often, or text pushed in); the model gets a short note when it changes and reads it with `context_read`; `chi context add <URL>` attaches a GitHub PR with the github-pr bundle; `chi context push NAME -m TEXT` (the long form is `--message TEXT`) gives a `--push` source its new text, read from stdin when no `-m` is given (see [Attached context](context.md))
|
|
24
24
|
- `chi context report [--days N]` — the candidate judge's counts from `context_candidates.jsonl`: candidates proposed, mentioned, attached or declined by you; the judge's asks; what it would attach per threshold, and how that agrees with what you did (this machine only; see [The log and the report](context.md#the-log-and-the-report))
|
|
25
|
-
- `chi send [-m TEXT] [--image PATH]... [--cut | --queue] (ID|PREFIX)...` — send a message to sessions as if typed there: a turn starts (or a running one takes it at its next step; `--cut` asks it to cut long thinking for it; `--queue` runs it as a turn of its own after the running one, and `--queue --wait` waits for that turn's own answer); piped stdin goes above `-m` as quoted context, and `--image` attaches images (see [Sessions: Sending a message](sessions.md#sending-a-message)); `--new` starts a session with it instead (`--new --continues ID|last:ID` the next link of that session's chain, see [Session chains](sessions.md#session-chains)), and `--wait` prints the answer (`--wait ID` with no message waits for the next reply without sending — to an idle session whose last turn already ended, that ended turn's reply or end comes back; `--wait --turn T ID` with no message waits for exactly turn T, whether running, queued or last ended; `--format json` includes its `turn_id` when known, for waiting again after exit 3 or 4; exit 3 a question waits, its options on stderr; exit 4 `--timeout` passed with the turn still running; see [Starting a session](sessions.md#starting-a-session))
|
|
25
|
+
- `chi send [-m TEXT] [--image PATH]... [--cut | --queue] (ID|PREFIX)...` — send a message to sessions as if typed there: a turn starts (or a running one takes it at its next step; `--cut` asks it to cut long thinking for it; `--queue` runs it as a turn of its own after the running one, and `--queue --wait` waits for that turn's own answer); piped stdin goes above `-m` as quoted context, and `--image` attaches images (see [Sessions: Sending a message](sessions.md#sending-a-message)); to a session that was continued it goes to its chain's newest link (`3f9a1c2e → 7b2d41aa (continued) sent`; the old link stays archived; one being continued right now waits up to 10 s for its new link, then `refused: being continued as 7b2d41aa; send again in a moment`), so a chain's first id is a stable address; `--new` starts a session with it instead (`--new --continues ID|last:ID` the next link of that session's chain, see [Session chains](sessions.md#session-chains)), and `--wait` prints the answer (`--wait ID` with no message waits for the next reply without sending — to an idle session whose last turn already ended, that ended turn's reply or end comes back; `--wait --turn T ID` with no message waits for exactly turn T, whether running, queued or last ended; `--format json` includes its `turn_id` when known, for waiting again after exit 3 or 4; exit 3 a question waits, its options on stderr; exit 4 `--timeout` passed with the turn still running; see [Starting a session](sessions.md#starting-a-session))
|
|
26
26
|
- `chi answer ID --question QID (--option N|LABEL)... [--text T] [--timeout S] [--format json]` (or `--dismiss`) — answer the question a session waits on (the one `chi send --wait` exited 3 with), then wait and print what comes next as `chi send --wait` does: the reply (0), the next question (3), still running after `--timeout` (4). `--option` is 1-based or the label, repeated on a multi-select question; `--text` is free text, or a Deny's reason; `--dismiss` leaves it unanswered and the model finishes its reply. A question no longer open (the web answered first) isn't answered again: it waits for that turn's reply. An option the question doesn't offer exits 2; a worker that is gone exits 1 (`send the task again: chi send --wait -m "…" ID`). What a parent may pick follows `guardrails.parent_answers`, or the session's own `parent_answers` when stricter (`soft`, the default: a deny, a plain answer, Continue and "Allow once"; `standard`: no allow; `hard`: no Continue either), never a wider scope or an allow on chi's own config; a refused pick exits 1 with what to answer instead (a convention, not a security boundary; see [Guardrails](guardrails.md#answers-from-a-parent-agent))
|
|
27
27
|
- `chi schedule <add|list|show|tick|run-now|enable|disable|cancel>` — durable schedules on this machine: a prompt with a clock that fires out of no worker (cron, systemd, or chi web's hub with `schedule.auto_tick`), as the next link of a session's chain or as a turn in the session itself (see [Scheduling](scheduling.md) and [Durable schedules](#durable-schedules-chi-schedule)). A usage error exits 2, an unknown session or schedule 1; `chi --remote X schedule list` exits 2
|
|
28
28
|
- `chi remote add NAME URL [--token-file F | --token-stdin]`, `chi remote ls`, `chi remote rm NAME` — the other machines whose chi web the session commands reach with `--remote NAME` (see [Remote sessions](#remote-sessions))
|
|
@@ -1534,19 +1534,26 @@ access token", paste the token there (the part of the link after
|
|
|
1534
1534
|
phone. The same sheet lists the other devices (a long-turns-done switch each, Remove), and `chi web push ls|rm|test`
|
|
1535
1535
|
does it from the Mac (see [Phone notifications](configuration.md#phone-notifications-web-push)).
|
|
1536
1536
|
|
|
1537
|
-
#### The session bar
|
|
1537
|
+
#### The session bar
|
|
1538
1538
|
|
|
1539
|
-
|
|
1540
|
-
|
|
1539
|
+
The session bar is one row at every window width, with no swiping and no second line. What doesn't fit folds into ⋯ by
|
|
1540
|
+
priority, the least needed first: the folder and the 🧰 toolkit, then model notes, the working set (or memories),
|
|
1541
|
+
participants and delegates, the model, the chain links, stop session, the speed, ⚙ (first down to its icon), continue →
|
|
1542
|
+
and the id. The status, ctx and ⋯ always stay. On a phone (600 px or less) the row is the status, ctx, the speed, ⚙ (its
|
|
1543
|
+
icon, a dot when the session set its own) and ⋯.
|
|
1541
1544
|
|
|
1542
|
-
|
|
1543
|
-
shows the full text a tooltip gives elsewhere), the working set (or the memories with `web.working_set` off), and, when the
|
|
1544
|
-
session has them, participants, chain links, the parent, delegates, model notes and an older worker's Restart;
|
|
1545
|
-
- one line with ctx, speed, the clock and the folder;
|
|
1546
|
-
- Continue, Archive (or Unarchive), Stop and Delete, under the same rules and confirmations as the wider screen's buttons.
|
|
1545
|
+
⋯ opens a popover (a bottom sheet on a phone) with what the row folded away:
|
|
1547
1546
|
|
|
1548
|
-
|
|
1549
|
-
|
|
1547
|
+
- a row for each folded chip, each opening what its chip opens: the id (a tap copies it), the model and the 🧰 toolkit (a
|
|
1548
|
+
tap shows the full text a tooltip gives elsewhere), ⚙, the working set (or the memories with `web.working_set` off),
|
|
1549
|
+
participants, chain links, the parent, delegates, model notes and an older worker's Restart;
|
|
1550
|
+
- one line with the folded ones of the speed, the clock and the folder;
|
|
1551
|
+
- Archive (or Unarchive) and Delete always, Continue and Stop when folded, under the same rules and confirmations as the
|
|
1552
|
+
buttons on the row.
|
|
1553
|
+
|
|
1554
|
+
On a wider screen ⋯ shows how many things it holds. A dot on ⋯ says something folded behind it needs a look: the accent when
|
|
1555
|
+
the working set changed or a participant is here, the warning colour when a delegate waits or the worker runs an older chi.
|
|
1556
|
+
The attached context's chips keep their own second line under the row.
|
|
1550
1557
|
|
|
1551
1558
|
### Remote sessions
|
|
1552
1559
|
|
|
@@ -1597,6 +1604,11 @@ CHI_REMOTE=studio chi context push claude-outbox ab12 < answer.json
|
|
|
1597
1604
|
a loosening `/parent-answers`, images to a model that can't see them. Each
|
|
1598
1605
|
target refuses its own (`ab12 refused: …`), where this machine refuses
|
|
1599
1606
|
before sending to any.
|
|
1607
|
+
- `send` to a session that was continued asks that machine for its chain's
|
|
1608
|
+
newest link first (`GET /api/sessions/resolve?id=X&head=1`, `{id, asked,
|
|
1609
|
+
via}`) and sends there. An older chi web ignores `head=1` and answers
|
|
1610
|
+
`{id}`: the message goes to the id named, as before. A participant's token
|
|
1611
|
+
never asks (their grant is for one session).
|
|
1600
1612
|
- Waits run on the server, 30 s at a time, until the answer or your own
|
|
1601
1613
|
`--timeout`; exit codes are the same. The commands chi prints for what to
|
|
1602
1614
|
do next work as pasted: they carry `--remote NAME` (`chi --remote studio
|
data/docs/configuration.md
CHANGED
|
@@ -1408,10 +1408,14 @@ launches it. It is recorded in `~/.config/samagotchi/home.json` (`$XDG_CONFIG_HO
|
|
|
1408
1408
|
"gem_path": "/Users/me/.gem/ruby/4.0.0:/Users/me/.local/share/mise/installs/ruby/4.0.7/lib/ruby/gems/4.0.0",
|
|
1409
1409
|
"mise": "/opt/homebrew/bin/mise",
|
|
1410
1410
|
"set_at": "2026-10-29T21:00:00Z",
|
|
1411
|
-
"set_by_version": "0.132.0"
|
|
1411
|
+
"set_by_version": "0.132.0",
|
|
1412
|
+
"version": 1
|
|
1412
1413
|
}
|
|
1413
1414
|
```
|
|
1414
1415
|
|
|
1416
|
+
(`version` is the file's format, `ChiHome::STATE_FORMAT`: a home.json without one is an older chi's, and a newer chi's
|
|
1417
|
+
keeps its version and the keys this chi doesn't know when the same home is set again.)
|
|
1418
|
+
|
|
1415
1419
|
- **Setting it.** `chi home set` records the Ruby your `chi` runs on and its gem path (a chruby shell's
|
|
1416
1420
|
`GEM_HOME`/`GEM_PATH` are part of it: that is where its chi lives); `chi home set --ruby PATH` records another
|
|
1417
1421
|
Ruby with its own gem dirs. Either needs samagotchi installed there (`gem install samagotchi` with that Ruby
|
data/docs/guardrails.md
CHANGED
|
@@ -339,21 +339,18 @@ else the parent's checkout). Rule `child-boundary`, source `core`; it asks when
|
|
|
339
339
|
- a call whose [targets](plugins.md#guardrails) say it writes its paths —
|
|
340
340
|
`write`, `edit`, and a plugin tool's `targets:` with `writes: true` —
|
|
341
341
|
names a path outside it (tmp dirs and memory files don't count);
|
|
342
|
-
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
`<common git dir>/worktrees/*/gitdir`) or in its common git dir
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
the child's folder. Its command's text may not be shell, so the reads a
|
|
355
|
-
shell call gets (its `git -C`/`cd` dirs, its redirects, its read-only test)
|
|
356
|
-
are left out.
|
|
342
|
+
- a shell call runs mutating git in another dir (`git -C`, `cd`, `GIT_DIR`:
|
|
343
|
+
what `git: outside_repo` matches), or a command that isn't read-only starts
|
|
344
|
+
outside it (its `cwd:`) or names a path in the repository's other checkouts
|
|
345
|
+
(the main one and sibling worktrees, read from
|
|
346
|
+
`<common git dir>/worktrees/*/gitdir`) or in its common git dir. A shell
|
|
347
|
+
call is `execute`, `task_create`, or a plugin call whose `targets:` carry a
|
|
348
|
+
`command:`;
|
|
349
|
+
- a shell call runs git that changes what every checkout shares, even from its
|
|
350
|
+
own worktree: a `git config` write (not `--get`, `--list`, `--worktree`),
|
|
351
|
+
`update-ref`, `worktree add|remove|move|prune`, `stash drop|clear|pop`,
|
|
352
|
+
creating or deleting a tag, and deleting, forcing or overwriting a branch
|
|
353
|
+
other than its own;
|
|
357
354
|
|
|
358
355
|
Read-only commands (`git -C ../app log`, `cat ../app/x`) and paths elsewhere
|
|
359
356
|
(`/usr/bin`, `~/.gem`) never ask, nor does a read-only command that writes only
|
|
@@ -738,7 +735,7 @@ guardrails:
|
|
|
738
735
|
mode: auto # or strict: also the rules tagged modes: [strict]; config.yml only
|
|
739
736
|
rules:
|
|
740
737
|
- id: git-push
|
|
741
|
-
tool: shell #
|
|
738
|
+
tool: shell # shell calls, including plugin targets with command:; or a name, glob or list
|
|
742
739
|
command: '\bgit\s+push\b' # Ruby regex on the command (data heredoc bodies left out)
|
|
743
740
|
verdict: ask # ask | deny
|
|
744
741
|
reason: git push publishes commits
|
|
@@ -15,7 +15,9 @@ model. The TUI is untouched: it shows a fence as source.
|
|
|
15
15
|
didn't know the key draws once a kept manifest is there) lists
|
|
16
16
|
who draws what: `GET /api/block_renderers`, `:owner`. `GET /api/block_renderers/:bundle/:file` serves a file, `:owner`:
|
|
17
17
|
the URL's names go through `BlockRenderers.script_path` (membership in a listed renderer's `load` before any path is
|
|
18
|
-
made), then `Provenance
|
|
18
|
+
made), then `Provenance#script_failure` (the check a context provider's scripts get too); a file with no recorded sha, a missing one or a changed one is 409
|
|
19
|
+
`renderer_changed`, each with its own reason. ETag + `no-cache`, as static files. A `block_renderers:` list that
|
|
20
|
+
doesn't parse is logged once per bundle and problem (each list request and file fetch reads it).
|
|
19
21
|
3. `block_watch.js` (`createBlockWatch`, made by `block_host.js`'s `createBlockHost`, wired in `app.js`; `participant.js`
|
|
20
22
|
isn't) finds and watches the blocks; `block_host.js` is its frame drawer (`createFrameDrawer`). The watcher asks an
|
|
21
23
|
ordered list of drawers, core ones first (`inline_widgets.js` for `chi-ui`: [inline-widgets.md](inline-widgets.md)), then the frame drawer, which waits for `/api/block_renderers`;
|
data/docs/internals/bridge.md
CHANGED
|
@@ -5,6 +5,8 @@ localhost HTTP server in the worker's process, next to the `Engine` it reads and
|
|
|
5
5
|
terminal are its clients; no browser reaches it. [architecture.md](../architecture.md) places it among the layers;
|
|
6
6
|
this page is the surface: what it keeps, how a client joins and catches up, and every route.
|
|
7
7
|
|
|
8
|
+
Bridge Engine calls are listed with their reasons in `Bridge::ENGINE_CALLS`; add each new Engine call there.
|
|
9
|
+
|
|
8
10
|
## What a Bridge keeps
|
|
9
11
|
|
|
10
12
|
`Bridge#start` binds a port (OS-assigned, `127.0.0.1`), then subscribes four persistent observers to the Engine
|
|
@@ -52,8 +54,7 @@ Three other users: `replay_events(turn)` turns a `current_turn` back into the li
|
|
|
52
54
|
`turn_started` also carries `at`, `cut_after` and every author key, then a `turn_enqueued` per queued prompt and a
|
|
53
55
|
`command_queued` per waiting command), which chi web's `GET /api/sessions/:id` sends as `replay` from the worker's
|
|
54
56
|
snapshot (`from_wire` symbolizes it), so any worker's snapshot gives the page the same events
|
|
55
|
-
(`spec/shared/turn_snapshot.json` pins it
|
|
56
|
-
release); `messages_of` gives a
|
|
57
|
+
(`spec/shared/turn_snapshot.json` pins it); `messages_of` gives a
|
|
57
58
|
plugin's `ctx.messages` the turn so far (`Engine#running_turn_messages`); `participant_turn?` tells `POST /turn` that
|
|
58
59
|
a participant's review turn runs, so the owner's input queues behind it.
|
|
59
60
|
|
|
@@ -448,7 +449,7 @@ The Bridge exposes:
|
|
|
448
449
|
`leaving_exit` / `leaving_delete` / `leaving_restart` when another client's exit of another kind is already taken
|
|
449
450
|
(`Worker#claim_exit`, claimed before a stop-all; the words are `WorkerIdleExit::LEAVING_WORDS`). A second exit of
|
|
450
451
|
the kind already taken is answered `200` as that one.
|
|
451
|
-
- `GET /session/:id/state` — `session_state_snapshot` (JSON).
|
|
452
|
+
- `GET /session/:id/state` — `session_state_snapshot` (JSON), read under the event lock so its `event_seq`/`event_id` match the state.
|
|
452
453
|
- `GET /session/:id/stats` — `Engine#stats_snapshot` for attached `/stats`: the metrics, with the context window and prompt profile asked from the server before the first turn.
|
|
453
454
|
- `GET /session/:id/activity` — `Worker#activity_snapshot`: `{session_id, turn_running, input_pending, awaiting_continue, open_streams, reminders, tasks_holding}` — what a `chi schedule tick` asks a live worker before it fires (the tick runs out of process and cannot read a worker's memory). Read-only and small (under 300 bytes). `501 activity_unavailable` when this Bridge was built without an `on_activity:` step; the worker advertises it in `Bridge::FEATURES` (`activity`). See [scheduling.md](../scheduling.md).
|
|
454
455
|
- `GET /session/:id/snapshot` — the snapshot frame's content as one request (the web server renders
|
data/docs/internals/bundles.md
CHANGED
|
@@ -179,8 +179,10 @@ its removal, so no edit is lost, and the record isn't written, so a retry is the
|
|
|
179
179
|
failed run already placed stay, and the intent journal says they are the bundle's.
|
|
180
180
|
|
|
181
181
|
**The intent journal.** After `check_named_files` and before the first write, a real run with a manifest writes
|
|
182
|
-
`.bundles/<name>/pending.json` (`Provenance#write_pending`, atomically like the record): `{"
|
|
183
|
-
"scope": "project", "target_dir": "/path/to/project-memories", "files": {"a.md": ["<sha256>"]}}
|
|
182
|
+
`.bundles/<name>/pending.json` (`Provenance#write_pending`, atomically like the record): `{"pending_format": 1,
|
|
183
|
+
"version": "2.0.0", "scope": "project", "target_dir": "/path/to/project-memories", "files": {"a.md": ["<sha256>"]}}`
|
|
184
|
+
(`pending_format` is its `StateFormat`, `PENDING_FORMAT`: a journal without it is an older chi's, the same members; a
|
|
185
|
+
newer chi's keeps its format and unknown keys through a retry's write, and the release corpus records one): the target
|
|
184
186
|
`version` is the latest run's target version, while `files` holds the union of incoming shas recorded by interrupted
|
|
185
187
|
runs for that scope/target directory. A retry of another version in the same target adds its incoming shas; a journal
|
|
186
188
|
for another scope directory is ignored. `Provenance#write` removes it with the record write; an uninstall's `rm_rf`
|
|
@@ -57,6 +57,10 @@ Pure Ruby, no web, no Engine. `parse(source)` returns a `Result`: `ok?`, `type`,
|
|
|
57
57
|
`next` or a `goto` goes. This is a mend, not a second lenient pass (`Tree#folds`, `Schema#text`).
|
|
58
58
|
- **Normalised.** Ids are strings, unknown keys are dropped, a repeated key is last-wins (`Tree#mapping`), optional values are absent rather than null, and text is
|
|
59
59
|
stripped. The page never sees model junk.
|
|
60
|
+
- **A row id never starts a command.** Fill reply puts a picks row's id first in the composer, so a leading `!` (a
|
|
61
|
+
shell line) or `/` (a session command), with the spaces between them, is dropped from it (`Schema#row_id`,
|
|
62
|
+
`COMMAND_LEAD`): `!touch x` is the id `touch x`, the Result `lenient?`, a mend like a fold. An id of nothing else is
|
|
63
|
+
refused, and the uniqueness check sees the mended ids. A walk's ids never reach the composer and stay as written.
|
|
60
64
|
|
|
61
65
|
### The schemas
|
|
62
66
|
|
|
@@ -98,7 +102,8 @@ session switch, a turn's end, Revise's clones, the stage's hand-off to `#history
|
|
|
98
102
|
- **Shadow DOM.** The host has an open shadow root holding the widget, with `widgets.css` adopted
|
|
99
103
|
(`adoptedStyleSheets`): the page fetches it once into a constructable `CSSStyleSheet` (`loadWidgetSheet`), and `draw`
|
|
100
104
|
returns a Promise that places the widget once it is there, so no widget flashes unstyled and the view held
|
|
101
|
-
(`holdingView`) measures the styled one. A failed fetch
|
|
105
|
+
(`holdingView`) measures the styled one. A failed fetch (an error, a non-2xx, or an answer that isn't
|
|
106
|
+
`text/css`, such as an auth proxy's login page) draws unstyled and the next draw tries again. Its words are then out of the bubble's `textContent`, which the shown-texts dedupe (`seedSeenFromDom`), copy's
|
|
102
107
|
fallback and an annotation's quote read, as with a renderer's `<img>`-only figure. chi's `:root` tokens reach it as
|
|
103
108
|
inherited custom properties, so light and dark follow the page. Playwright's locators pierce an open shadow root;
|
|
104
109
|
`page.evaluate`'s DOM calls don't. Whatever asks `document.activeElement` whether a field has the focus looks
|
|
@@ -115,14 +120,19 @@ session switch, a turn's end, Revise's clones, the stage's hand-off to `#history
|
|
|
115
120
|
(a move that removes or hides the focused button leaves the focus on the widget; a click on the current step is no
|
|
116
121
|
move). `walkRoutes`
|
|
117
122
|
resolves where a step goes: its `next` (`end`: nowhere), else the step below; a fork's `cases` as written, a case whose `when` is no
|
|
118
|
-
condition (round 1's `always`) reading as the usual path, alone it is the step's next.
|
|
123
|
+
condition (round 1's `always`) reading as the usual path, alone it is the step's next. A fork none of whose cases
|
|
124
|
+
moves on (each loops back to an earlier step or its own) keeps Next beside them (`hasNext`): its unwritten usual
|
|
125
|
+
path, the step below or Start over, or the walk would be stuck there. At a phone's width the
|
|
119
126
|
swimlane scrolls sideways inside the widget; the page doesn't.
|
|
120
127
|
- **picks** (`widget_picks.js`): one row per item, its options as chips (`aria-pressed`), the recommended one marked
|
|
121
128
|
and picked to start with, a "+ note" per row, and "Fill reply".
|
|
122
129
|
|
|
123
130
|
**The only way out is composer text.** Fill reply builds `id: option (note) · …` from the picked rows (a row with no
|
|
124
131
|
pick is left out) and hands it to app.js's `fillComposer`, after a typed draft on a new line (`withDraft`; the draft
|
|
125
|
-
is kept). It never sends: the owner reads the text and sends it or not.
|
|
132
|
+
is kept). It never sends: the owner reads the text and sends it or not. `replyText` drops a leading `!` or `/` from
|
|
133
|
+
an id too (an id of only those is its row's number), so the filled text never starts a shell line or a session command
|
|
134
|
+
even from data the normaliser didn't mend; the draft before it is the owner's own. The row's `wp-id` chip shows that
|
|
135
|
+
same cleaned id (`rowId`, one rule for both), so what is drawn is what fills. A walk has no way out at all. The model's
|
|
126
136
|
strings reach the page through `textContent` and attributes only, never `innerHTML`, so a step reading
|
|
127
137
|
`<img src=x onerror=…>` shows as those characters.
|
|
128
138
|
|
|
@@ -84,10 +84,15 @@ registry flag (`--recap-base-url` …) is this machine's config: `LOCAL_ONLY` wi
|
|
|
84
84
|
1. **bin/chi → Dispatch.** The flag is removed. `send` and `send --message` / `--wait` are `SUPPORTED`. `Remotes.find("studio")`
|
|
85
85
|
reads `$XDG_CONFIG_HOME/samagotchi/remotes.yml`. Then `SendCommand.new(argv, access: Remote.new(entry)).run`.
|
|
86
86
|
2. **SendCommand.** The client-side checks (UI-only slash commands, image ingest) run. The machine-local ones are
|
|
87
|
-
skipped (next section).
|
|
87
|
+
skipped (next section). Every id is resolved once up front (`SendCommand#target`): `Remote#resolve`, then
|
|
88
|
+
`Remote#head`, where input for it goes (a continued session's chain's newest link).
|
|
88
89
|
3. **Remote → HTTPTransport.** The first request on a `Remote` is preceded by `check_server!`, which sends
|
|
89
90
|
`GET /api/info` and needs `app: "chi-web"` plus the `session_commands` feature. Next come
|
|
90
|
-
`GET /api/sessions/resolve?id=ab12
|
|
91
|
+
`GET /api/sessions/resolve?id=ab12`, `GET /api/sessions/resolve?id=<full id>&head=1` (`{id, asked, via}`:
|
|
92
|
+
`SessionInbox::Head.resolve(:send, …)` on the server, `via` `same`, `head` or `continuing`; an older chi web
|
|
93
|
+
ignores `head=1` and answers `{id}`, read as `same`, so the message goes to the id named as before; a participant's
|
|
94
|
+
token never asks, and the participant branch of the route answers `{id}` alone) and
|
|
95
|
+
`POST …/wait/prepare {busy: true, queue:}` (`Remote#busy`) on the id it answered, then
|
|
91
96
|
`POST …/wait/prepare {turn, created}` for the `WaitStart`. `deliver` calls `Remote#show` and `#owner` (each
|
|
92
97
|
`GET /api/sessions/:id?brief=1`), then
|
|
93
98
|
`POST …/turn {prompt, client_id: "cli:send", history: false}`. A 202 ack becomes a `DeliverResult` with `via`
|
|
@@ -218,15 +218,42 @@ createFamilyPop`) still place their own. Every popover behaves the same (`popove
|
|
|
218
218
|
none behind. `model_picker.js`, `command_list.js` (listboxes: the focus stays in the input), `ref_menu.js` (a menu)
|
|
219
219
|
and `update_sheet.js` (a native modal `<dialog>`) aren't popovers in that sense.
|
|
220
220
|
|
|
221
|
-
**
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
221
|
+
**The session bar: one row** (`bar_fold.js`, `more_sheet.js`): `#infoBar` is one row at every width, and what doesn't
|
|
222
|
+
fit folds into ⋯. Every chip and button is an **item** of `info_bar_model.js` `BAR_ITEMS`: `{key, selector, group,
|
|
223
|
+
rank, phone, compact, menuOrder}`. `rank` is the desktop fold order (higher stays longer; `pinned` never folds: status,
|
|
224
|
+
ctx, ⋯; `menu` is never on the row: archive, delete); `phone: row` items are the only row candidates at 600 px or less
|
|
225
|
+
(status, ctx, speed, ⚙, ⋯); ⚙ alone has a `compact` form (its icon, the dot when the session set its own), tried before
|
|
226
|
+
it folds, and the phone's from the start. `info_bar.js` draws the `.meta` as four groups (identity: id, status, ctx,
|
|
227
|
+
speed, clock | setup: ⚙, model, 🧰, notes, set/mem | relations | trail: folder, worker badge), each `.bar-sep` classed
|
|
228
|
+
by the group it precedes; `#infoActions` (continue →, stop session) and ⋯ follow, right-aligned.
|
|
229
|
+
|
|
230
|
+
The **fold** is `foldPlan` (pure): every candidate full, then while the row is wider than the bar the lowest rank on it
|
|
231
|
+
(all items of that rank together) goes compact, else folds; pinned items never fold (the row clips). Its widths are
|
|
232
|
+
measured, never read from a squeezed box: the row's children are `flex:none` and the caps (model 40ch, folder 48ch)
|
|
233
|
+
hold always, so a drawn chip's width is its natural one. `createBarFold` caches them per key + text; a folded item has
|
|
234
|
+
no box, so a text first seen while folded is measured by dropping the fold's attributes for one synchronous pass
|
|
235
|
+
(before paint). ⋯'s count joins the row's width once something it counts folds. The live chips (ctx, speed, clock) are
|
|
236
|
+
cached per key as a budget (their CSS reserve is their `min-width`): a tick within it costs a width read, no refold.
|
|
237
|
+
A recompute runs only when an input changes: `foldSignature(bar, buttons)` (the items present and every non-live
|
|
238
|
+
text: a status, `set 9 → set 10`, a delegate starting to wait), the bar's width (`ResizeObserver` on `#infoBar`), the
|
|
239
|
+
phone profile, a live chip past its budget, the fonts ready or a zoom (those clear the cache). A recompute it starts by
|
|
240
|
+
itself calls `onChange` (app.js touches `infoBar`) so ⋯ follows. Call order in `app.js updateInfoBar`: `renderInfoBar`
|
|
241
|
+
→ `barFold.update` → `moreSheet.update({bar, buttons, folded})`, in one task. The plan is three attributes on
|
|
242
|
+
`#infoBar` (lit renders into `#infoText` inside it, so they survive the redraws): `data-folded="notes toolkit dir"`,
|
|
243
|
+
`data-compact="settings"`, `data-empty-groups="relations"`; index.html has one `display:none` selector per key and
|
|
244
|
+
hides an empty group with its hairline. **A new chip needs a `BAR_ITEMS` entry and its `data-folded` selector**
|
|
245
|
+
(`bar_fold.test.js` checks every foldable key has one), or it can't fold.
|
|
246
|
+
|
|
247
|
+
⋯'s menu (`more_sheet.js`) is a popover above 600 px and a bottom sheet under it (`chip_popover.js`, `SHEET_MAX`; its
|
|
248
|
+
own resize handling switches them, so a width change doesn't close it). It holds a row only for a folded item (the id,
|
|
249
|
+
⚙ when folded and not compact, "earlier links pruned" included), the folded ones of speed, clock and folder on its
|
|
250
|
+
telemetry line (none: no line), archive and delete always, continue and stop when folded. Its dot (`moreAttention`)
|
|
251
|
+
and its count (`moreCount`, a desktop's, none at 0; archive and delete don't count) are from folded items alone: a chip
|
|
252
|
+
on the row shows its own state. Folded items stay in the DOM, display:none: a row or an action clicks the real chip or
|
|
253
|
+
button, so each keeps one set of handlers, confirmations and in-flight rules, and what a chip opens has no box to be
|
|
254
|
+
placed at, so `chip_popover.js` places it, marks `aria-expanded` and gives focus back at the page's
|
|
255
|
+
`[data-anchor-stand-in]` (⋯). Rows and actions draw into fixed slots, so a row that joins keeps the focus where it was.
|
|
256
|
+
The e2e reach an item wherever it is with `spec/e2e/support/layout.js` `clickBarItem` (the row, else ⋯'s `[data-row]`).
|
|
230
257
|
|
|
231
258
|
|
|
232
259
|
## The stage's height
|
data/docs/memory.md
CHANGED
|
@@ -32,8 +32,13 @@ the folder is left as is: it is created when missing, nothing is marked).
|
|
|
32
32
|
(`chi context --project`) are named by the marker's `id:` (`<folder name>-<8 random hex>`), not
|
|
33
33
|
by its path, so moving or renaming the folder keeps them: a session started there after the move
|
|
34
34
|
finds them, and one saved before it (its file stores `project_id`) keys its context sources by the
|
|
35
|
-
id too.
|
|
36
|
-
|
|
35
|
+
id too. An existing id folder is used only when its `.root` claims this project, or when its
|
|
36
|
+
previous claimant or a saved session's root no longer has this id after a move; otherwise chi
|
|
37
|
+
refuses and says to run `chi project init --new-id`. An id folder with no `.root` is taken when its
|
|
38
|
+
name has a path key's shape (`<name>_<8 hex>`: another project's folder); one of any other name (an
|
|
39
|
+
older chi's id folder) is used and claimed at session start. A folder chi
|
|
40
|
+
already ran in at its top keeps its memories after `init`: they move to the id. A later `git init`
|
|
41
|
+
in the folder makes it a repository, keyed by its path again (git wins): its
|
|
37
42
|
memories stay in the id folder until you move them, and chi names the id folder at session start
|
|
38
43
|
(and under a `memory_read` miss) while the repository's own folder holds no memories. Memories saved from a *subfolder* before
|
|
39
44
|
`init` stay in that subfolder's own folder (keyed by its path); `chi project init` and `chi project`
|
|
@@ -59,11 +64,11 @@ the folder is left as is: it is created when missing, nothing is marked).
|
|
|
59
64
|
but never moves folders: a folder it marks that already has path-keyed memories gets no id until
|
|
60
65
|
`chi project init`.
|
|
61
66
|
- **A copy shares memories.** A copied marked folder (`cp -R`) keeps the id, so the two share one
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
id folder. At session start chi claims a new id folder in `.root`; if another marked folder still
|
|
68
|
+
has that id, chi warns and refuses to use the folder's memories or project context sources.
|
|
69
|
+
`chi project init --new-id` in the copy gives it a fresh id, but does not copy an id folder claimed
|
|
70
|
+
by another project. After a move, the new path takes `.root` over when the old path no longer has
|
|
71
|
+
that id, with no warning.
|
|
67
72
|
- **Restart what runs there.** A session running in the folder when it is marked keeps the old memories
|
|
68
73
|
folder and AGENTS.md chain in its prompt until `chi sessions restart ID` (init names them); a running
|
|
69
74
|
`chi web` groups the folder's older sessions under the project after its restart.
|