samagotchi 0.186.0 → 0.187.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 +14 -1
- data/bin/chi +2 -0
- data/docs/cli.md +1 -0
- data/docs/internals/inline-widgets.md +18 -0
- data/docs/internals/pages.md +172 -0
- data/docs/internals/web-frontend.md +5 -4
- data/docs/memory.md +7 -0
- data/docs/pages.md +150 -0
- data/lib/samagotchi/bundles/system/manifest.yml +5 -2
- data/lib/samagotchi/bundles/system/self_map.md +5 -1
- data/lib/samagotchi/bundles/system/skill_pages.md +93 -0
- data/lib/samagotchi/inline_widgets.rb +65 -0
- data/lib/samagotchi/page_command.rb +234 -0
- data/lib/samagotchi/pages/builder.rb +187 -0
- data/lib/samagotchi/pages/launch.rb +187 -0
- data/lib/samagotchi/pages/runner.rb +154 -0
- data/lib/samagotchi/pages/store.rb +143 -0
- data/lib/samagotchi/pages.rb +119 -0
- data/lib/samagotchi/run_options.rb +1 -0
- data/lib/samagotchi/session_access/contract.rb +1 -1
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/app.rb +5 -5
- data/lib/samagotchi/web/page_routes.rb +116 -0
- data/lib/samagotchi/web/public/app.js +24 -84
- data/lib/samagotchi/web/public/index.html +3 -0
- data/lib/samagotchi/web/public/page_blocks.js +58 -0
- data/lib/samagotchi/web/public/page_links.js +33 -0
- data/lib/samagotchi/web/public/page_model.js +68 -0
- data/lib/samagotchi/web/public/page_route.js +24 -0
- data/lib/samagotchi/web/public/page_table.js +74 -0
- data/lib/samagotchi/web/public/page_table_model.js +76 -0
- data/lib/samagotchi/web/public/page_view.js +218 -0
- data/lib/samagotchi/web/public/pages.css +77 -0
- data/lib/samagotchi/web/public/pages_group.js +65 -0
- data/lib/samagotchi/web/public/views.js +161 -0
- data/lib/samagotchi/web/viewer.rb +1 -1
- metadata +21 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94944da48a4a9a500ba050224b49cacf5613427dbdb58da43ea6cff2cdc8c41b
|
|
4
|
+
data.tar.gz: 65ab72242e7cb6fb521c13583e96c9daddf02030bfa70a2a002cfb1cc36496be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e5de8e8c4e68d41371295de2d3b17d0336525d260e9b72a956a3731792110ba32249610ca8515499f5fa32bf868f8c6c9122818253693007a4571daae9063a4
|
|
7
|
+
data.tar.gz: 2afe94681dce8e824a9408a9230e4acbcec11d4ec3a06473b72932c29dab093b947cf7425e0a38da753474252c75814bb9cdc4a2846ec9c40441a9ce8154cc78
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,18 @@ and commands may change between minor versions. How releases are made:
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.187.0] - 2026-11-23
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Pages: ask chi for "a page of …" and it writes a small Ruby script under the config's `pages/` folder that builds
|
|
16
|
+
text, a table and a walk (the shipped pages skill teaches it how). `chi page run | list | rm` runs, lists and
|
|
17
|
+
removes them; a run gets 30 s, one at a time per page, and a failed run keeps the last result under its failure
|
|
18
|
+
line. In chi web a page opens at `#/p/NAME` (All sessions → Pages, or a `#/p/` link in an answer, in place): Refresh
|
|
19
|
+
runs it again, a table sorts on a desktop and opens its rows on a phone, and ⋯ deletes it. Owner only.
|
|
20
|
+
|
|
21
|
+
Update with `chi update`.
|
|
22
|
+
|
|
11
23
|
## [0.186.0] - 2026-11-23
|
|
12
24
|
|
|
13
25
|
### Added
|
|
@@ -6813,7 +6825,8 @@ and long-lived sessions.
|
|
|
6813
6825
|
- A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
|
|
6814
6826
|
hotkey panel that send selected text or the clipboard to your sessions.
|
|
6815
6827
|
|
|
6816
|
-
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.
|
|
6828
|
+
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.187.0...HEAD
|
|
6829
|
+
[0.187.0]: https://github.com/dm1try/samagotchi/compare/v0.186.0...v0.187.0
|
|
6817
6830
|
[0.186.0]: https://github.com/dm1try/samagotchi/compare/v0.185.0...v0.186.0
|
|
6818
6831
|
[0.185.0]: https://github.com/dm1try/samagotchi/compare/v0.184.0...v0.185.0
|
|
6819
6832
|
[0.184.0]: https://github.com/dm1try/samagotchi/compare/v0.183.0...v0.184.0
|
data/bin/chi
CHANGED
|
@@ -91,6 +91,8 @@ SUBCOMMANDS = {
|
|
|
91
91
|
"desktop" => ["samagotchi/desktop_command", "DesktopCommand"],
|
|
92
92
|
# list and remove memories (ls, rm; --scope, --format)
|
|
93
93
|
"memory" => ["samagotchi/memory_command", "MemoryCommand"],
|
|
94
|
+
# pages: scripts that say what to show (run, list, rm)
|
|
95
|
+
"page" => ["samagotchi/page_command", "PageCommand"],
|
|
94
96
|
# install, upgrade, uninstall, status, diff, list, build (--scope, --force, …)
|
|
95
97
|
"bundle" => ["samagotchi/bundle_command", "BundleCommand"],
|
|
96
98
|
# the System 1 record: replay the asks this machine's sessions already answered
|
data/docs/cli.md
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
- `chi project`, `chi project init [--new-id | --merge-subfolders] [DIR]` — this folder's project, and making a folder in no git repository one. `chi project` prints how its project was found (`kind` `git`, `marker` or `none`), its `root`, its `top` (where the AGENTS.md chain starts), a marked project's `id` (what its memories and project context are keyed on; else the root's path is) and its project `memories` folder, with a `note` for a marker a repository makes ignored, or a `$HOME` that is a git repository. `init` writes `DIR/.chi/project.yml` with a new `id:` (DIR defaults to this folder and is created when missing), so DIR and every subfolder share one memories folder (kept when DIR moves or is renamed), group their sessions and take `chi context --project`; it writes nothing in a git repository (the repository already is the project, exit 0), says so (with the id) for a folder already marked, refuses `$HOME`, a folder above it and `/` (exit 1), and marks a folder inside another marked project as its own, nested one. On a folder marked without an id (an older chi's marker) it adopts one: the folders keyed by its path move to the id, each leaving a link by its old name, and it says what moved and names memories an earlier path left (refused, exit 1, while a session of the project runs). `--new-id` gives a marked folder a fresh id with a copy of its memories and project context (a copied folder going its own way; refused elsewhere, exit 1). Memories a session on this machine saved in a subfolder before init (keyed by that subfolder's path) are named by `init` and by `chi project` (a `note`); `--merge-subfolders` moves them into the project's memories folder (marking DIR first when it isn't yet): a memory the project has by that name, or a bundle's, stays and is named, an emptied folder is removed; refused, exit 1, while a session in DIR runs; not with `--new-id` (exit 2). It prints the root, the id and the memories folder (with the memories already there: a folder chi ran in at its top keeps them, moved to the id), the running sessions in DIR to restart (`chi sessions restart ID`: their prompt keeps the old project) and, when DIR has saved sessions, that a running chi web groups them after its restart. This machine only. See [Projects without git](memory.md#projects-without-git)
|
|
41
41
|
- `chi bundle install|upgrade|uninstall|status|diff|list|build|trash|new|test|check` — manage memory bundles (see [Plugins](plugins.md) and [Bundle hooks](hooks.md#bundle-hooks)); `list` shows the installed ones and the ones shipped with chi, which `install <name>` installs; `upgrade <name>` upgrades an installed bundle by name from the source it came from (its folder, archive or git URL), `upgrade <source>` from a new one; `core` and `dev` are profiles that install a set of them (see [Bundle profiles](memory.md#bundle-profiles-core-and-dev), [Guardrails](guardrails.md), [Bundles](bundles.md#the-btw-bundle), [the mcp bundle](bundles.md#the-mcp-bundle) [the loop-guard bundle](bundles.md#the-loop-guard-bundle), [the check-in bundle](bundles.md#the-check-in-bundle) and [the skills bundle](bundles.md#the-skills-bundle)). `trash` lists and empties the bundle trash (moved files from uninstalls/upgrades). `install`/`upgrade` `--force` overwrites existing entries and also installs a bundle whose `requires_chi` this chi doesn't meet and a memory, plugin or script whose bytes disagree with its manifest `sha256`; without it such a bundle or file is refused (exit 1), nothing written. `install` and `upgrade` (`--dry-run` too) start with the bundle and its version: `NAME OLD → NEW` when it changes, `NAME VERSION` when it doesn't (or for a new install), and `NAME VERSION (already current)` when the run writes nothing, in place of the `Up to date: …` line. A plain `install` of a bundle that is already installed from the same source rewrites its rules, plugin, scripts and record: the summary lists a file that already holds the bundle's bytes as `Up to date: …`, one you wrote as `Skipped: …`, and ends with `NAME was already installed from SOURCE: its rules, plugin and scripts now match it and its record was rewritten` (plus, when a memory was kept, `your own copies of its memories were kept (chi bundle upgrade NAME merges the bundle's changes into them)`). A source with class-file hooks (`hooks/*.rb` or a manifest `hooks:` entry) is refused, `--dry-run` too; an older install's hooks are removed by the next install or upgrade (`Removed (chi no longer loads class-file bundle hooks): …`, an edited one copied to the trash first; see [Class-file hooks are retired](hooks.md#class-file-hooks-are-retired)). `status NAME` lists the bundle's guardrail rules and scripts beside its plugin, each `[ok]`, `[missing]` or `[modified]` (edited: the next install replaces it, its copy kept in the trash; an edited rule doesn't load, so it counts in `issues=`), and `diff NAME` names an edited rule or script with its recorded and current sha256 (chi keeps no base text for them). A usage error (an unknown subcommand or flag, a missing argument, a bad `build --scope`) exits 2, as for the other subcommands. Plain `chi` and `chi web` exit 1 on an unknown flag, a flag missing its value or a stray argument. `new`, `test` and `check` are for writing one: see [Writing a bundle](#writing-a-bundle-new-test-check)
|
|
42
42
|
|
|
43
|
+
- `chi page run NAME [--format text|json]` — run the page script `~/.config/samagotchi/pages/NAME.rb` in a Ruby process of its own (in the pages folder, cut at 30 s with what it started) and store what it built; it prints a summary per block (a text's first lines, a table's labels, first rows and total, a walk's steps), or `error: line N: …` with the script's stderr and "the result of … is kept". `--format json` prints the stored page. `chi page list [--format text|json]` — each page's title and `ran … ago`, `failed … ago (line N)` or `(never ran)`, `changed` when the script changed since. `chi page rm NAME` removes the script and its result. Exit 1 when the script raised, was stopped or broke a limit, when there is no such page or it is already running; 2 for the command line (an unknown flag, a name that isn't lowercase letters, digits and hyphens) — see [Pages](pages.md)
|
|
43
44
|
- `chi guardrails replay [--dry-run] [--threshold T] [--model M]` — seed System 1's record from the approvals this machine's sessions already answered: each ask is judged by the configured model and written to `guardrails/judgments.jsonl` with the answer the user gave, then a per-rule table prints (asks, allowed, denied, would-be auto-allows, false allows, asks with no judgment). A parent agent's answer is not the user's: only its deny is replayed, and only where the parent could have allowed. `--dry-run` judges without writing, `--threshold` overrides `guardrails.system_one.threshold` for the table, `--model` the configured model for this run. Exit 2 when `guardrails.system_one.mode` is off or no `host` is set; a usage error exits 2 (see [System 1](guardrails.md#system-1-experimental))
|
|
44
45
|
- `chi guardrails rule <id>` — print exactly `asks` when that rule is loaded, not disabled and votes `ask` in this `guardrails.mode` for every model; any other line says why not (no such rule, disabled, another mode, it denies, for some models only, rules that failed to load, `guardrails.enabled: false`). Exit 0 either way, 2 for a usage error. It reads config.yml and the installed bundles as a worker does (`GuardrailWiring#rules`) and takes the rule's id, never a command; the [coordinator skill](bundles.md#the-coordinator-bundle) reads it before it merges without asking
|
|
45
46
|
- `chi judgments ls` / `chi judgments report NAME [--days N]` — what [System 1's saved runs](system-one.md) hold: each judgment's digests, runs, labels, failures, models and size; one judgment's counts, p histogram and labels by value. Reads only; local only; `--days` must be a positive whole number.
|
|
@@ -88,6 +88,24 @@ The source is at most 16 KB, checked before the parse. After it: a picks has at
|
|
|
88
88
|
and 2-5 unique actors, and every string is at most 300 characters. An error repeats at most 40 characters of a bad
|
|
89
89
|
`type`, and never a tag.
|
|
90
90
|
|
|
91
|
+
### The data entry
|
|
92
|
+
|
|
93
|
+
`InlineWidgets.check(type, data)` takes a script's Hash instead of YAML (a page's `ui.walk`,
|
|
94
|
+
[pages.md](pages.md#the-data-entry-into-inlinewidgets)) and returns the same `Result`, so the same widget draws it.
|
|
95
|
+
|
|
96
|
+
- **One deep conversion first** (`DataTree.convert`), into what `Tree` hands `Schema`: keys made strings (a Symbol or an
|
|
97
|
+
Integer as its text; another key is refused), a String kept (scrubbed to valid UTF-8), a Symbol or a number made its
|
|
98
|
+
text, nil kept (absent, as YAML's empty value). `true`, `false` and anything else are refused with the path to them
|
|
99
|
+
(`steps[1].sees must be text, not true`; indexes from 0). A root that isn't a Hash is refused.
|
|
100
|
+
- **Its own guards:** the type is one of `TYPES` (a Symbol is taken); nesting past `MAX_DEPTH` and a Hash or Array that
|
|
101
|
+
holds itself are refused ("the data nests too deep"), with the `SystemStackError` rescue kept as the backstop.
|
|
102
|
+
- **`Schema` unchanged**, built with an empty identity Hash for folds: the same caps and rules as a block (30 steps,
|
|
103
|
+
2-5 actors, 12 rows, 300 characters) and the same messages. No folds and no lenient pass: the Result's `lenient` is
|
|
104
|
+
always false, a picks id `row_id` mends included (there was no source to be lenient with).
|
|
105
|
+
- The entry's own messages speak of "the data"; `parse` and its messages are untouched, which
|
|
106
|
+
`spec/inline_widgets_golden_spec.rb` pins (every fixture's type, data, lenient and error, in
|
|
107
|
+
`spec/fixtures/inline_widgets_golden.json`, beside the fixtures folder, whose files `inline_widgets_spec.rb` counts).
|
|
108
|
+
|
|
91
109
|
## The page (`inline_widgets.js`)
|
|
92
110
|
|
|
93
111
|
`createWidgetDrawer` is a core drawer of `block_watch.js` (its header has the contract), wired in `app.js` ahead of the
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Pages: the builder, the store, the runner
|
|
2
|
+
|
|
3
|
+
The user side is [pages.md](../pages.md). This is how a run happens and what it leaves.
|
|
4
|
+
|
|
5
|
+
## The pieces
|
|
6
|
+
|
|
7
|
+
| File | What |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `lib/samagotchi/pages.rb` | `Pages`: the limits, the name rule (`check_name!`, the one check before any path), the folders, the errors (`Refused`, `BadName`, `Missing`, `Busy`, each owning its message), the values `Stored` and `Failure` |
|
|
10
|
+
| `pages/builder.rb` | `Builder` (the script's `ui`: `text`, `table`, `walk`) and `TableBlock` (columns, formats, key columns, cells, the total) |
|
|
11
|
+
| `pages/store.rb` | `Store`: read, list, `record_run`, `record_failure`, `locked`, `remove`, `file_id` |
|
|
12
|
+
| `pages/runner.rb` | `Runner.run(argv)`: the runner process's whole job |
|
|
13
|
+
| `pages/launch.rb` | `Launch.run(name, timeout:, cancelled:)`: the one launch path |
|
|
14
|
+
| `page_command.rb` | `chi page run | list | rm` |
|
|
15
|
+
|
|
16
|
+
`pages.rb` requires json, digest, time, `inline_widgets`, `paths` and `atomic_file`, and autoloads its parts. Nothing
|
|
17
|
+
it reaches requires the engine, the config, the web, the plugins, `ChildEnv` or `ProcessGroup`: the runner loads it
|
|
18
|
+
alone. `launch.rb` is the only file that needs `ChildEnv` and `ProcessGroup`, and nothing in `pages.rb` requires it.
|
|
19
|
+
|
|
20
|
+
## The one launch path
|
|
21
|
+
|
|
22
|
+
`chi page run` does not run the script in its own process. `Launch.run` starts the runner, exactly as chi web's
|
|
23
|
+
Refresh will (Build 2), so a page that passes from the terminal passes on Refresh (the spike saw two paths give a
|
|
24
|
+
script 152 against 73 preloaded libraries and a stale `PWD`). It costs about 70 ms more per terminal run.
|
|
25
|
+
|
|
26
|
+
1. `Pages.check_name!`, then the script must exist (`Missing`), then `Store.locked(name)`: a non-blocking `flock` on
|
|
27
|
+
`<state>/samagotchi/pages/NAME.lock`, beside the page's folder so `remove` can delete the folder while holding it.
|
|
28
|
+
Held: `Busy` ("page NAME is already running"). The order means a typo leaves no lock file behind. `locked` yields
|
|
29
|
+
the lock's io.
|
|
30
|
+
2. `ProcessGroup.spawn(env, RbConfig.ruby, "-I", <this chi's lib>, "-e", 'require "samagotchi/pages/runner"; exit
|
|
31
|
+
Samagotchi::Pages::Runner.run(ARGV)', NAME, TIMEOUT, DEADLINE, 3 => lock)`, in a group of its own, `chdir:` the
|
|
32
|
+
pages folder, stdin closed, the lock on fd 3. The env is a worker's changes
|
|
33
|
+
(`SessionManager::WorkerCommand#spawn_options`): `ChildEnv.unbundled` (an installed gem's Bundler changes undone),
|
|
34
|
+
`ChildEnv.unset` (the spawner's guardrails settings and session markers), `Launch.cleared_keys` unset
|
|
35
|
+
(`CHI_REMOTE`, every `SAMAGOTCHI_WORKER_*` key and the vendor agent markers `AgentCaller::VENDOR_MARKERS`:
|
|
36
|
+
`CLAUDECODE`, `CODEX_THREAD_ID`, `AI_AGENT`, read from those constants), `Paths.absolute_xdg`, and `PWD` set to the
|
|
37
|
+
pages folder (spawn's `chdir:` doesn't change it). So a run never goes remote, never looks like a worker's child,
|
|
38
|
+
and a script's `chi send` is the owner's even from a chi web started in an agent's pane. "This chi's lib" is
|
|
39
|
+
`File.expand_path("../..", __dir__)` from `pages/launch.rb`: a checkout and an installed gem alike.
|
|
40
|
+
3. stdout and stderr are each read by a `ProcessGroup::PipeReader` (64 KB, the tail kept).
|
|
41
|
+
4. The wait polls `Process.wait2(pid, WNOHANG)`. At the timeout (30 s) `ProcessGroup.stop` TERMs the group, CONTs it,
|
|
42
|
+
waits a grace, then KILLs, with a `stopped:` that reaps (an unreaped zombie counts as alive to the default check).
|
|
43
|
+
Descendants that moved to a group of their own are found and stopped too (`walk:`); one that left the tree
|
|
44
|
+
(`setsid` and its parent gone) survives: the stated limit. `cancelled:` (a callable, chi web's "am I stopping?")
|
|
45
|
+
is polled in the same loop: true stops the group the same way, recorded as "the run was stopped".
|
|
46
|
+
5. After **any** exit the group gets a KILL (a script's background child would hold the pipes open), and the readers
|
|
47
|
+
are bounded (`reader.wait(grace) || reader.kill`).
|
|
48
|
+
6. The runner wrote the output file, or the launcher records the failure itself: the cut ("the script was stopped
|
|
49
|
+
after 30 s"), or "the runner ended without a result" (with stderr's last line) when the exit status is not 0 or 1
|
|
50
|
+
or the file is the one that was there before. "The one that was there before" is the file's inode
|
|
51
|
+
(`Store.file_id`): `AtomicFile` renames a new file in for every write, so a run that wrote changes it even within
|
|
52
|
+
one second.
|
|
53
|
+
7. An interrupt or an exception stops and reaps the group in `ensure`; the lock is released by the `File.open` block.
|
|
54
|
+
|
|
55
|
+
**A launcher that dies mid-run** (chi web or a terminal killed with `KILL`) runs no `ensure`. The runner holds the
|
|
56
|
+
lock too (the flock is shared through fd 3), so the page stays "already running" while it lives, and it ends itself:
|
|
57
|
+
its `DEADLINE` is the timeout + `Launch::GRACE_SECONDS` + `Launch::DEADLINE_MARGIN` (2 s) from its own start, later
|
|
58
|
+
than the launcher's cut, which wins whenever the launcher is alive. At the deadline a thread in the runner records
|
|
59
|
+
the cut itself ("the script was stopped after N s") and KILLs the runner's group. So a killed launcher leaves at most
|
|
60
|
+
one bounded run. A Ruby thread can't fire while a C extension holds the GVL: such a script outlives its deadline
|
|
61
|
+
until the call returns (accepted). The runner's stdout and stderr are pipes whose reader died with the launcher: Ruby
|
|
62
|
+
ignores SIGPIPE, so the script's next output that reaches the pipe (a large one, or `$stdout.sync`) raises
|
|
63
|
+
`Errno::EPIPE`, recorded as the script's failure at that line (the good blocks stay; small output stays buffered and
|
|
64
|
+
only fails at the exit, after the result is written). Accepted: the run stays bounded, only the error's words mislead.
|
|
65
|
+
|
|
66
|
+
`ContextFetch#run_command`, `#wait` and `#stop_group` are the model this follows.
|
|
67
|
+
|
|
68
|
+
## The runner
|
|
69
|
+
|
|
70
|
+
`Runner.run(argv)` (requiring `pages/runner.rb` runs nothing) first makes fd 3 close-on-exec, so the lock is the
|
|
71
|
+
runner's alone: a program the script execs (`spawn`, `system`, backticks), even one that leaves the group and
|
|
72
|
+
outlives the run, never inherits it (it would keep the page "already running" for good). A `fork` without an exec
|
|
73
|
+
(`Process.daemon` too) keeps fd 3 and holds the lock while it lives: the stated limit. A script's own `exec` replaces
|
|
74
|
+
the runner: the lock goes (close-on-exec) and so does the deadline thread; a live launcher still cuts it (it stays in
|
|
75
|
+
the group), but after a dead launcher the exec'd program runs unbounded while the page is runnable again (the same
|
|
76
|
+
limit). It arms the deadline when argv carries one (a write of the result and the deadline's record take one mutex,
|
|
77
|
+
and the write sets a done flag under it, so a result written before the deadline fires is never overwritten), checks
|
|
78
|
+
the
|
|
79
|
+
name and the script, then
|
|
80
|
+
`load(path, dsl)`: the wrap module is a fresh `Module` defining only `page`, so the script's own `def`s land in it, not
|
|
81
|
+
on `Object`. `page(title) { |ui| … }` makes a `Builder`; a second call raises `Refused`. After the load, no `page` call
|
|
82
|
+
fails the run too.
|
|
83
|
+
|
|
84
|
+
It rescues `StandardError`, `ScriptError`, `SystemExit`, `SystemStackError` (endless recursion) and `NoMemoryError` (never a `SignalException`: a TERM is the launcher's cut,
|
|
85
|
+
recorded by the launcher). The line is the first backtrace entry inside the script file (the exact path given to
|
|
86
|
+
`load`), or for a `ScriptError` the `path:LINE:` at the start of its message's first line, which every Ruby gives; the
|
|
87
|
+
message drops that prefix. An `exit 3` is "the script called exit 3". A good run goes through `Store.record_run`, which
|
|
88
|
+
refuses an output over 256 KB (`Refused`, recorded as the failure). Exit 0 ran, 1 the script failed, 2 no such page.
|
|
89
|
+
The result reaches the launcher through the file only: a `puts` in a script corrupts nothing.
|
|
90
|
+
|
|
91
|
+
## The output file
|
|
92
|
+
|
|
93
|
+
`<state>/samagotchi/pages/NAME/output.json`, written with `AtomicFile.write`:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{"name": "usage", "title": "Usage, last 7 days",
|
|
97
|
+
"blocks": [{"type": "text", "text": "…"},
|
|
98
|
+
{"type": "table",
|
|
99
|
+
"columns": [{"key": "model", "label": "Model"},
|
|
100
|
+
{"key": "cost", "label": "Stored", "format": "money", "key_column": true}],
|
|
101
|
+
"rows": [["claude:sonnet-5-5", 14.221]], "total": ["Total", 18.1252], "dropped": 0},
|
|
102
|
+
{"type": "walk", "data": {"title": "…", "actors": ["…"], "steps": ["…"]}}],
|
|
103
|
+
"ran_at": "2026-11-23T10:00:00Z", "duration_ms": 412, "script_sha": "<sha256 of the script that made the blocks>",
|
|
104
|
+
"error": null}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- A failed run rewrites only `error`: `{"message", "line" (Integer or null), "at", "script_sha"}`. The blocks, title,
|
|
108
|
+
`ran_at` and `script_sha` stay those of the last good run. A good run sets `error` to null. `Store.record_failure` is
|
|
109
|
+
the one writer of a failure, for the runner and the launcher alike, always under the page's lock.
|
|
110
|
+
- Before any good run there are no blocks and `ran_at` is null.
|
|
111
|
+
- A table's `format` is stored, not applied: cells stay raw numbers so the page can sort them. `key_column` marks the
|
|
112
|
+
columns a phone shows besides the first (never marked).
|
|
113
|
+
- `Store.read` gives a `Stored`: the fields, `state` (`:never_ran`, `:ok`, `:failed`) and `changed?` (the script's
|
|
114
|
+
sha256 now differs from `script_sha`). "Changed" means only this: the result on screen came from an older script;
|
|
115
|
+
every surface uses `changed?` as it is, never a meaning of its own. A missing or unreadable file reads as never ran; keys this version doesn't
|
|
116
|
+
know are dropped on read (a newer chi's file reads fine).
|
|
117
|
+
|
|
118
|
+
## The data entry into InlineWidgets
|
|
119
|
+
|
|
120
|
+
`ui.walk` hands its Hash to `InlineWidgets.check("walk", data)`, the same `Schema` the chat's YAML goes through, so the
|
|
121
|
+
same widget draws it ([inline-widgets.md](inline-widgets.md#the-data-entry)).
|
|
122
|
+
|
|
123
|
+
## chi web
|
|
124
|
+
|
|
125
|
+
**The routes** (`web/page_routes.rb`, `Web::PageRoutes`, its `ROUTES` splatted into `App::ROUTES` on the models row),
|
|
126
|
+
all `:owner`: a participant's token gets 403 `not_permitted` (`participant_gate_spec` sweeps them). The name capture is
|
|
127
|
+
`([^/]+)`, checked with `Pages.valid_name?` before any path is built; a name that breaks the rule is no such page.
|
|
128
|
+
|
|
129
|
+
| Route | Answers |
|
|
130
|
+
|---|---|
|
|
131
|
+
| `GET /api/pages` | `{pages: [{name, title, state, ran_at, failed_at, changed, error_line}]}`, by name (`Store.list`) |
|
|
132
|
+
| `GET /api/pages/NAME` | the page (below); 404 `page_missing` with no script. Runs nothing |
|
|
133
|
+
| `POST /api/pages/NAME/run` | `Launch.run(name, timeout: 30, cancelled: -> { !@server_running.call })` inside the request; the page as after the run, with `stderr` (its last 2 KB) when it failed; 409 `page_busy`, 404 `page_missing`, 503 `server_stopping` (chi web's stop ended it: "the run was stopped") |
|
|
134
|
+
| `DELETE /api/pages/NAME` | `Store.remove`: `{removed: NAME}`; 409 `page_busy`, 404 `page_missing` |
|
|
135
|
+
|
|
136
|
+
The page: `{name, title, state, ran_at, duration_ms, changed, changed_after_failure, script_changed_at, error:
|
|
137
|
+
{message, line, at} | null, blocks}`. `changed` is `Stored#changed?`; `changed_after_failure` says the script differs
|
|
138
|
+
from the one that failed (so the page needs no sha); `script_changed_at` is the script's mtime. A text block carries
|
|
139
|
+
`html`, the `MarkdownRenderer`'s sanitised render, when rendering is available (`web.markdown`), else `text` only.
|
|
140
|
+
The error codes' `detail` is the exception's own message.
|
|
141
|
+
|
|
142
|
+
**The capability** `pages` (`Web::Viewer::CAPABILITIES`, never a participant's) makes the view, the group and the link
|
|
143
|
+
handler; without it none is made and no page call goes out (`viewer_boot.test.js`).
|
|
144
|
+
|
|
145
|
+
**The page's modules** (`lib/samagotchi/web/public/`): `page_route.js` (`pageHash`, `pageNameFromHash`, the open rule:
|
|
146
|
+
never a participant's, never without `pages`), `views.js` (reads the page hash before the session intent:
|
|
147
|
+
`body.page-view`, `openPage` / `closePage` / `leavePage`, the session hash not written while a page is open, a session
|
|
148
|
+
picked leaving the page), `page_view.js` (the header, the states, the calls; an answer for a page no longer open is
|
|
149
|
+
dropped, `latest.js`), `page_model.js` (the words: meta, the failed and changed lines, Copy the error), `page_blocks.js`
|
|
150
|
+
(text, walk in a widget host with `drawWalk`, an unknown type as one muted line), `page_table.js` and
|
|
151
|
+
`page_table_model.js` (cells, sort, the phone's rows), `pages_group.js` (All sessions' group), `page_links.js` (the
|
|
152
|
+
delegated click on the turn roots and the page view for `#/p/` anchors), `pages.css`. What a script wrote reaches the
|
|
153
|
+
page as text or attributes, never as markup, except the server's sanitised `html`.
|
|
154
|
+
|
|
155
|
+
**Not live**: no stream event and no polling. A run from a terminal shows on the next open; two tabs are not kept in
|
|
156
|
+
step.
|
|
157
|
+
|
|
158
|
+
## chi's side: the skill
|
|
159
|
+
|
|
160
|
+
What chi knows about pages is one memory, the system bundle's `skill_pages.md` (an index line in every prompt, the
|
|
161
|
+
text read on demand), and the `chi page` line in `self_map.md`. `spec/pages_skill_spec.rb` runs the skill's example
|
|
162
|
+
through `Runner::Collector`'s DSL and pins every command, `ui` call and limit it names to the code; a change to the
|
|
163
|
+
skill's text regenerates the turn goldens (`UPDATE_PROMPTS=1`).
|
|
164
|
+
|
|
165
|
+
The eval behind it (2026-11-23, the local Qwen3.8-Flash-Next, `chi -p … --non-interactive` in isolated dirs, N=5 per
|
|
166
|
+
task): 14 of 15 pages ran and showed the reference numbers, no ask was raised, and the task that doesn't name the
|
|
167
|
+
skill read it 5 of 5 times; without the skill (`--mute skill_pages`, N=3) 1 of 3 made a page. The archive is the
|
|
168
|
+
owner's `~/.claude/plans/evals/0016-pages-skill/`.
|
|
169
|
+
|
|
170
|
+
## Later builds
|
|
171
|
+
|
|
172
|
+
- Not planned yet: picks on a page, a data API (`runtime`), a bundle's pages, parameters.
|
|
@@ -14,7 +14,7 @@ by `npm run e2e` (`spec/e2e/`). `app.js` has no unit spec of its own; `viewer_bo
|
|
|
14
14
|
**Every module has a size cap, `app.js` its own**: `npm run lint` fails past `max-lines` in `eslint.config.js`
|
|
15
15
|
(counted as `wc -l` counts, comments and blank lines too). Every `public/*.js` module: 1200 (`samagotchi/module-size`,
|
|
16
16
|
about 10% over the largest, `turn_block.js`), so a module near it splits rather than becoming the next `app.js`.
|
|
17
|
-
`app.js` (`samagotchi/app-size`): 1637, its size once the diagrams' wiring went into `diagram_wiring.js
|
|
17
|
+
`app.js` (`samagotchi/app-size`): 1577, its size once the views by hash went into `views.js` and the pages' wiring landed; down from 1637, its size once the diagrams' wiring went into `diagram_wiring.js`, itself down from 1638,
|
|
18
18
|
its size once the lightbox went into `picture_viewer.js`, itself down from 1649, its
|
|
19
19
|
size plus 50 once the session-open flow went into `session_sync.js` and `session_view.js`, itself ratcheted down from 2000, itself down from 2250 when the versions, the owner's claim links and
|
|
20
20
|
Verify, the composer's mode and the strip's hide went into modules of their own. A new feature goes into a module of
|
|
@@ -37,7 +37,7 @@ sheet still keeps `isChained` and `format.js deleteConfirmText` that way; and `w
|
|
|
37
37
|
with 0.183.0's `ws_reader.js` and `ws_peek.js`, and 0.183.0's view with this `ws_reader.js`, from
|
|
38
38
|
`spec/web/public/fixtures/v0.183.0/`). `answer_fold.js`, `details_motion.js`,
|
|
39
39
|
`turn_range.js`, `history_reveal.js`, `latest.js`, `session_payload.js`, `method_api.js`, `session_store.js`,
|
|
40
|
-
`session_fields.js`, `feature_gates.js`, `revise_stack.js`, `revise_switch.js`, `shell_command.js`, `stale_params.js`, `popover_modal.js`, `more_sheet.js`, `delete_sheet.js` (The delete sheet, below), `removal_sheet_model.js` (its words: rows, button words, the archive model, the toast; DOM-free), `running_tasks.js` (a delete's or archive's tasks: their line and the toast's suffix; DOM-free, so `stop_sheet.js` and the delete sheet share its cut), `hash_intent.js` (what the hash asks for: session, all, start or keep), `worker_features.js`, `version_notices.js`, `owner_claim.js`, `owner_verify.js`, `composer_mode.js`, `strip_hidden.js`, `block_open.js`, `text_roots.js`, `block_source.js`, `block_frame.js`, `block_host.js`, `block_watch.js`, `card_stamps.js`, `recap_stamp.js` (a saved recap's place by its `opening_id` stamp, else its count), `inline_widgets.js`, `widget_walk.js`, `widget_picks.js`, `history_shape.js` (the history's shape, live against a reload: the e2e reload checks and the opt-in reload check share its normalizer and its `ACCEPTED` allowlist), `turn_pieces.js` (a finished turn's one order and its answer rule: the live hand-off's `handOffOrder` and `turnEnded`, and a reload's `turnHistoryNodes`), `reload_check.js` (the opt-in `web.reload_check`: after the stage's hand-off, the turn against a reload of it, the counts posted; the history without its cards and questions, and those as data: the page's `card_registry.js` against one seeded from the read, this turn's entries, a capped read's missing keys skipped), `turn_drawing.js` (a finished turn's drawing, `turn_drawings` in the show: its fold into steps and its end kind; `turn_block.js` draws it), `stage_stall.js` (the stage's quiet signal), `stage_quiet_clock.js`, `stage_dom.js`, `stage_answer.js`, `stage_pager.js`, `stage_cloud.js`, `stage_handoff.js`, `stage_place.js`, `stage_probe.js` (the stage's features: below, The stage's modules), `card_kinds.js` (what a card waits as, from its data: the kind, approval and folded-row text the stage's registry takes; the node's read is its cross-check), `card_registry.js` (the open session's cards as data, an observer of the stream's card events and a read's seed: Where state lives), `history_end.js` (the stage's one move of pieces to the history's end), `stage_opened.js` (a running turn opened in the history while a card waits: the lead-in bubble, the moves, the end fold), `stage_asking.js` (the stage's docked card and its fold: the docking and lead-in rules, the opening, a waiting card's own toggle, the folded row's text per kind, the fold's choice, reveal and the docked card's fold; `stage_view.js` wires it), `stage_waiting.js` (the stage's waiting cards as data, keyed by `data-qid` / `data-card-id`: kind, docked, approval, the stage's order, the shown card and its pager, the docked card's fold, kept for this tab in `chi_asking_fold:<session>`; `front`, `count`, `shown`, `blocking`), `stage_cards.js` (the cards that wait in the stage: `PENDING`, `ASKS`, `waitsInStage`, read by `stage_model.js placeKind`), `resync_reach.js` (a re-read that can't reach chi web keeps the drawn history; the status chip says retrying / offline, outside a turn), `session_sync.js` (the open session's sync: `select`, `resync` and its retries, the stream's life; the stream handle and the re-read bookkeeping are its own), `session_view.js` (the open session's view: `renderSessionView` draws a read, `forgetSession` resets the page for another session, `readTurnEnd`, `endTurnView`; app.js makes both right after the cards, each reaching the other and the later views through getters), `participant_main.js`, `participant_bar.js`, `viewer_self.js`, `participant_history.js` (a participant's ↑/↓ list), `stage_owner_wait.js`, `participant_revise.js` (a participant's page: The participant's page, below), `ws_timeline.js`, `ws_cards.js`, `ws_peek.js`, `ws_part_peek.js`, `ws_reader.js`, `ws_way_in.js`, `ws_item_sig.js`, `ws_markdown.js` (what chi has of a working-set item: below, The working set's reader), `session_prefs.js` (a session's own view settings, `<key>:<session>`: Storage keys, below), `ws_sections.js` (the working set's head view: its sections from the prompt's parts, [working-set.md](working-set.md), The head view), `ws_order.js` (the working-set list's order: last touched first, held while it is open, [working-set.md](working-set.md), The list's order), `ctx_tokens.js` (the context's token count beside its %: `ctxTokens`, below), `stage_view_memory.js` (what was opened of a running turn, per session, in memory: Where state lives), `peer_data.js`, `peer_exchange.js`, `peer_note.js`, `peer_links.js`, `peer_text.js` (a peer's send and answer in the conversation: The peer exchange, below), `peer_chip.js` (a paired peer's one chip in the session bar: The peer exchange), `picture_viewer.js` (the picture viewer, `#lightbox`: below, Picture viewer), `pan_zoom.js` (its maths, pure), `diagram_wiring.js` (`wireDiagrams`: the block host with the viewer as its `openPicture`, the viewer closed on a theme change, the regions' layer given to the viewer; the viewer itself stays made in app.js, which `createSessionView` reads first), `block_regions.js` (a renderer's regions cleaned, pure: [block-renderers.md](block-renderers.md#regions)), `region_hit.js` (their hit test, the arrow keys' nearest region and the reveal under the card, pure), `picture_regions.js` (the regions' layer over the viewer: below, Picture viewer), `no_contact_fill.js` (a text field that isn't a contact form: autocomplete off and a name with no contact word, against iOS Safari's AutoFill Contact bar; a template's fields carry the same attributes, and its spec checks the page's markup for them) and the `objectives_*.js` modules are new modules for that reason. The last four `block_*` draw fenced blocks (`block_watch.js` finds and watches them, `block_host.js` is its frame drawer for a bundle's renderers): [block-renderers.md](block-renderers.md). `inline_widgets.js` is its core drawer for `chi-ui` blocks, drawing `widget_walk.js`'s and `widget_picks.js`'s widgets in a shadow root styled by `widgets.css`: [inline-widgets.md](inline-widgets.md).
|
|
40
|
+
`session_fields.js`, `feature_gates.js`, `revise_stack.js`, `revise_switch.js`, `shell_command.js`, `stale_params.js`, `popover_modal.js`, `more_sheet.js`, `delete_sheet.js` (The delete sheet, below), `removal_sheet_model.js` (its words: rows, button words, the archive model, the toast; DOM-free), `running_tasks.js` (a delete's or archive's tasks: their line and the toast's suffix; DOM-free, so `stop_sheet.js` and the delete sheet share its cut), `hash_intent.js` (what the hash asks for: session, all, start or keep), `views.js` (the views by hash, in one place: All sessions at `#/sessions` opened, closed and left; a page at `#/p/NAME`, read before the session intent, `hashIntent` calling it `keep`: `body.page-view`, Back to where it was opened from, the session's hash not written while it is open, a session picked leaving it; the session's `#/s/<id>` written; a hash change applied and selected; app.js makes it after the lists and hands its functions lazily to what it made before), the page's modules `page_route.js`, `page_view.js`, `page_model.js`, `page_blocks.js`, `page_table.js`, `page_table_model.js`, `pages_group.js` and `page_links.js` (a page in chi web: [pages.md](pages.md#chi-web)), `worker_features.js`, `version_notices.js`, `owner_claim.js`, `owner_verify.js`, `composer_mode.js`, `strip_hidden.js`, `block_open.js`, `text_roots.js`, `block_source.js`, `block_frame.js`, `block_host.js`, `block_watch.js`, `card_stamps.js`, `recap_stamp.js` (a saved recap's place by its `opening_id` stamp, else its count), `inline_widgets.js`, `widget_walk.js`, `widget_picks.js`, `history_shape.js` (the history's shape, live against a reload: the e2e reload checks and the opt-in reload check share its normalizer and its `ACCEPTED` allowlist), `turn_pieces.js` (a finished turn's one order and its answer rule: the live hand-off's `handOffOrder` and `turnEnded`, and a reload's `turnHistoryNodes`), `reload_check.js` (the opt-in `web.reload_check`: after the stage's hand-off, the turn against a reload of it, the counts posted; the history without its cards and questions, and those as data: the page's `card_registry.js` against one seeded from the read, this turn's entries, a capped read's missing keys skipped), `turn_drawing.js` (a finished turn's drawing, `turn_drawings` in the show: its fold into steps and its end kind; `turn_block.js` draws it), `stage_stall.js` (the stage's quiet signal), `stage_quiet_clock.js`, `stage_dom.js`, `stage_answer.js`, `stage_pager.js`, `stage_cloud.js`, `stage_handoff.js`, `stage_place.js`, `stage_probe.js` (the stage's features: below, The stage's modules), `card_kinds.js` (what a card waits as, from its data: the kind, approval and folded-row text the stage's registry takes; the node's read is its cross-check), `card_registry.js` (the open session's cards as data, an observer of the stream's card events and a read's seed: Where state lives), `history_end.js` (the stage's one move of pieces to the history's end), `stage_opened.js` (a running turn opened in the history while a card waits: the lead-in bubble, the moves, the end fold), `stage_asking.js` (the stage's docked card and its fold: the docking and lead-in rules, the opening, a waiting card's own toggle, the folded row's text per kind, the fold's choice, reveal and the docked card's fold; `stage_view.js` wires it), `stage_waiting.js` (the stage's waiting cards as data, keyed by `data-qid` / `data-card-id`: kind, docked, approval, the stage's order, the shown card and its pager, the docked card's fold, kept for this tab in `chi_asking_fold:<session>`; `front`, `count`, `shown`, `blocking`), `stage_cards.js` (the cards that wait in the stage: `PENDING`, `ASKS`, `waitsInStage`, read by `stage_model.js placeKind`), `resync_reach.js` (a re-read that can't reach chi web keeps the drawn history; the status chip says retrying / offline, outside a turn), `session_sync.js` (the open session's sync: `select`, `resync` and its retries, the stream's life; the stream handle and the re-read bookkeeping are its own), `session_view.js` (the open session's view: `renderSessionView` draws a read, `forgetSession` resets the page for another session, `readTurnEnd`, `endTurnView`; app.js makes both right after the cards, each reaching the other and the later views through getters), `participant_main.js`, `participant_bar.js`, `viewer_self.js`, `participant_history.js` (a participant's ↑/↓ list), `stage_owner_wait.js`, `participant_revise.js` (a participant's page: The participant's page, below), `ws_timeline.js`, `ws_cards.js`, `ws_peek.js`, `ws_part_peek.js`, `ws_reader.js`, `ws_way_in.js`, `ws_item_sig.js`, `ws_markdown.js` (what chi has of a working-set item: below, The working set's reader), `session_prefs.js` (a session's own view settings, `<key>:<session>`: Storage keys, below), `ws_sections.js` (the working set's head view: its sections from the prompt's parts, [working-set.md](working-set.md), The head view), `ws_order.js` (the working-set list's order: last touched first, held while it is open, [working-set.md](working-set.md), The list's order), `ctx_tokens.js` (the context's token count beside its %: `ctxTokens`, below), `stage_view_memory.js` (what was opened of a running turn, per session, in memory: Where state lives), `peer_data.js`, `peer_exchange.js`, `peer_note.js`, `peer_links.js`, `peer_text.js` (a peer's send and answer in the conversation: The peer exchange, below), `peer_chip.js` (a paired peer's one chip in the session bar: The peer exchange), `picture_viewer.js` (the picture viewer, `#lightbox`: below, Picture viewer), `pan_zoom.js` (its maths, pure), `diagram_wiring.js` (`wireDiagrams`: the block host with the viewer as its `openPicture`, the viewer closed on a theme change, the regions' layer given to the viewer; the viewer itself stays made in app.js, which `createSessionView` reads first), `block_regions.js` (a renderer's regions cleaned, pure: [block-renderers.md](block-renderers.md#regions)), `region_hit.js` (their hit test, the arrow keys' nearest region and the reveal under the card, pure), `picture_regions.js` (the regions' layer over the viewer: below, Picture viewer), `no_contact_fill.js` (a text field that isn't a contact form: autocomplete off and a name with no contact word, against iOS Safari's AutoFill Contact bar; a template's fields carry the same attributes, and its spec checks the page's markup for them) and the `objectives_*.js` modules are new modules for that reason. The last four `block_*` draw fenced blocks (`block_watch.js` finds and watches them, `block_host.js` is its frame drawer for a bundle's renderers): [block-renderers.md](block-renderers.md). `inline_widgets.js` is its core drawer for `chi-ui` blocks, drawing `widget_walk.js`'s and `widget_picks.js`'s widgets in a shadow root styled by `widgets.css`: [inline-widgets.md](inline-widgets.md).
|
|
41
41
|
|
|
42
42
|
## One page, every viewer
|
|
43
43
|
|
|
@@ -58,7 +58,7 @@ their viewer (The viewer, below), their show and stream are filtered (`Web::Part
|
|
|
58
58
|
| **The session store** (`session_store.js`; app.js `store`) | `store.selected` (the open session's id), `store.current` and `store.sessions` (below) | through the store only (see The session store); other modules get getters (`selected: () => store.selected`, `state: () => store.current`) or the store itself (`stream_handlers.js`, `send_turn.js`, `session_actions.js`) | the store runs the redraws that read what changed (below); nobody calls them by hand |
|
|
59
59
|
| **app.js module scope**: about a dozen top-level `let`s (`eventsControl`, `pageCapabilities`/`pageEditorUrl`, `scopeError`…); the open session's stream handle and re-read bookkeeping (`streamControl`, `resyncsInFlight`/`resyncAgain`, `resyncAttempts`) are `session_sync.js`'s, in its closure | the page's mode and its streams | their module only; other modules get getters and hooks (`sessionSync.hasStream()`: a stream object, also while it connects, the bar's streaming; `streamLive()`: it delivers) | the writer touches the redraw that reads it (`store.touch("infoBar")`: the stream; `version_notices.js` does it for the versions and its `restarting` set), or calls a redraw only it feeds |
|
|
60
60
|
| **`store.current`** (`session_state.js`: `emptySessionState` / `sessionStateFrom`; per field: `session_fields.js FIELDS`) | the open session's fields, about 40 (info bar, chips, verdicts, timing, worker, stream cursor) | `store.update` / `setStatus` from app.js, `stream_handlers.js`, `session_sync.js`, `session_view.js`, `send_turn.js` (`firstPreview`, `owner`), `session_actions.js` (`status`), `owner_verify.js` (`verdicts`, `verifyFresh`); `forgetSession`'s `replaceCurrent` (`session_view.js`). Two writers in place, on purpose (D8 in `FIELDS`): live_timing.js's `activeTurn`, verdict_fresh.js's running list | the store runs the field's redraws (`FIELDS[key].redraws`) |
|
|
61
|
-
| **`store.sessions`** (the hub's projection) | every card | `store.update({sessions})` from app.js: `openSessionEvents` (`applySessionEvent`), `refresh` (the list fallback), `addCreatedSession`, `applyView` (re-sorted), `replaceSelectedCard` (`setLiveStatus` through `setStatus`, `readTurnEnd`, `setUsedMemories`), the stream's close (`withoutWorker`); `session_actions.js` (`setSessions`) | the store: `lists` and `infoBar`. **Always a new array**; an entry is replaced, never changed in place. `followSelectedSession` copies the open one's owner and worker (`fieldsFromCard`) and, when not streaming, its status (`setStatus(…, "hub")`) into `store.current` |
|
|
61
|
+
| **`store.sessions`** (the hub's projection) | every card | `store.update({sessions})` from app.js: `openSessionEvents` (`applySessionEvent`), `refresh` (the list fallback), `addCreatedSession`, `views.js applyView` (re-sorted), `replaceSelectedCard` (`setLiveStatus` through `setStatus`, `readTurnEnd`, `setUsedMemories`), the stream's close (`withoutWorker`); `session_actions.js` (`setSessions`) | the store: `lists` and `infoBar`. **Always a new array**; an entry is replaced, never changed in place. `followSelectedSession` copies the open one's owner and worker (`fieldsFromCard`) and, when not streaming, its status (`setStatus(…, "hub")`) into `store.current` |
|
|
62
62
|
| **Factory closures**: the `create*` factories (popovers, panels, views) | each component's own state: open-for, busy, error, its own fetched list | the factory | an `onChange` hook back into app.js, or a getter the factory reads at draw time |
|
|
63
63
|
| **The history DOM** | the conversation as drawn (a running turn's reason bubble, `.bubble.said`, is live only: see A turn opened in the history): which turn a bubble belongs to (`data-turn-id`, `data-answer-turn`), what opens a turn (`TURN_PROMPT`, `bubbles.js`: a prompt or a wake's note, the same turns `Steer.turn_opening?` counts for a card's `turns_since`), an opening's id for a card's and the saved recap's stamp (`data-turn-id` on a prompt, `data-opening-id` on a wake's note or `/continue no`'s reason line; `card_stamps.js` places a snapshot's card after the stamped opening, `recap_stamp.js` the saved recap after the last turn it covers, each by its count (`turns_since`) only without one), kept command bubbles, which texts were shown, unnamed badges, folded answers and long prompts (`.folded`), Revise stamps (`data-revises` on a prompt; a Verify turn's `data-verify`) and the stacks' folded versions (`.stack-hidden`, `.stack-stub.open`); the switcher's version on view is `revise_stack.js`'s own (a copy `.stack-view` before the top answer, the top `.stack-swapped`; never stored) | `bubbles.js`, `cards_place.js`, `question_cards.js`, `turn_block.js`/`stage_view.js`, `answer_fold.js`, `revise_stack.js`, `stream_handlers.js` (a live `turn_completed`'s `revises` and `verify` onto its prompt) | read back as state: `turn_range.js turnElements` (one walker for a turn's elements), `keptCommandBubbles`, `seedSeenFromDom`, `nameUnnamedBadges`/`nameVerdictCards`, `answer_fold.js` and `revise_stack.js` (their observers decorate every path that fills `#history`; the stacks are `stacks()` of the stamps, read again on each change, never a store field), `history_reveal.js revealInHistory` (the one way a jump unfolds what hides its target) |
|
|
64
64
|
| **A drawn turn** (`turn_drawings` of the full read) | every finished turn, as live drew it: `turnGroups` groups by the stamps only, a turn's stamped items (`drawn: <turn_id>`) one group, and `turnHistoryNodes` draws it by feeding its drawing's events to a live turn block offscreen (`turn_block.js drawnTurnNodes`: the block's own handlers, as the stage's), the stage's extras (a reminder, merged lines, a card that waited when it arrived, an answered question) in the order live left them for the history (`turn_settle.js settleOrder`, pure: from the drawing's `part_settled` and question events, whether the turn was opened, and whether a question had a lead-in) and the end as live, then the answer, the merged lines and the steps' texts from their saved items (markdown, refs). Each of its top-level elements carries `data-drawn`: `cards_place.js` leaves that turn's in-turn CardStore entries (`of_turn`) to it, and a kept reminder bubble of that turn (`data-turn-id`) stays out after a resync. chi web sends a drawing for every finished turn (one made from its messages where live wrote none): `drawnGroup` pairs the record the end names (`end.record_id`, by place for a turn saved before turn ids), else by the turn's id, and the answer's `data-answer-turn` is the end's own `turn_id` only (a made-up id, `m…` or `…~N`, keys none: no Revise). Nothing is rebuilt from messages: an item that comes unstamped is a `plain` group drawn as a plain row of its text (its prompt or answer bubble, no steps), the running turn's as expected (`runningTurnId`, the show's `current_turn`: it has no line yet), any other a miss, marked `data-undrawn`, logged once per render (`console.warn`) and counted by the reload check (`undrawn`), never a throw; a drawing with no parts (a minimal line) draws its prompt, answer and end | chi web (the show) | `renderHistory`, the reload check's render |
|
|
@@ -263,6 +263,7 @@ gates are boot-time: a show's narrower `viewer` changes what `viewer.can` answer
|
|
|
263
263
|
| `block_renderers` | a bundle's drawn blocks (the core `chi-ui` drawer stays) | `/api/block_renderers*` |
|
|
264
264
|
| `stop_any_turn` | the stage's Stop turn (`onCancel`) | `POST …/cancel` |
|
|
265
265
|
| `steer_any_turn` | none: the delivery line reads a participant's own `steer_own_turn` instead (`viewerTurn`) | |
|
|
266
|
+
| `pages` | the page view (`#pageView`, `page_view.js`), All sessions' Pages group (`#pagesGroup`), the `#/p/` link handler (`page_links.js`); without it a `#/p/…` hash is no page | `GET /api/pages` (when All sessions opens), `GET /api/pages/:name` (a page opened), `POST …/run` (Refresh), `DELETE /api/pages/:name` |
|
|
266
267
|
|
|
267
268
|
A participant's `can` (`Viewer::PARTICIPANT_CAPABILITIES`, in their show's `viewer` and on `<body>`) names
|
|
268
269
|
capabilities of their own, not the owner's: `send` (the composer), `stop_own_turn` (Stop turn on a turn they
|
|
@@ -492,7 +493,7 @@ kept: every open starts fitted.
|
|
|
492
493
|
- **It closes by itself**, whatever it shows, on a system theme change (the diagram behind is redrawn; the viewer
|
|
493
494
|
holds the old picture; `diagram_wiring.js`), on a switch to another session or the start page (`session_view.js
|
|
494
495
|
forgetSession`, given `pictures`; the same session again keeps it) and when the all-sessions view opens (it hides
|
|
495
|
-
`#center`, the viewer's parent;
|
|
496
|
+
`#center`, the viewer's parent; `views.js applyView`). A bubble rewritten or cloned while it is open leaves it as it
|
|
496
497
|
is: it holds its own copy of the URL. The toast may show over it (both z-index 50, the toast later); it is modal by
|
|
497
498
|
`aria-modal`, `#center`'s other children aren't made `inert`.
|
|
498
499
|
- index.html keeps `<div id="lightbox" hidden><img alt=""></div>`: an older cached app.js reads that `<img>`. The
|
data/docs/memory.md
CHANGED
|
@@ -441,6 +441,13 @@ skills`, [docs/bundles.md](bundles.md#the-skills-bundle)) adds `/skill save`,
|
|
|
441
441
|
one-line diff after each update, and nudges a model that skips a failing
|
|
442
442
|
step instead of fixing the skill.
|
|
443
443
|
|
|
444
|
+
chi ships one skill itself: `skill_pages` in the system bundle
|
|
445
|
+
(`lib/samagotchi/bundles/system/skill_pages.md`), how to make, check and link a
|
|
446
|
+
page ([docs/pages.md](pages.md#asking-chi-for-a-page)). Its index line is in
|
|
447
|
+
every prompt; its text is read only when a page is asked for. It tells chi not
|
|
448
|
+
to edit it (a shipped file: a local edit would have to be merged at the next
|
|
449
|
+
upgrade) but to say what differed.
|
|
450
|
+
|
|
444
451
|
## Toolkit memories
|
|
445
452
|
|
|
446
453
|
A memory named `toolkit_<name>` defines a toolkit named `<name>`. Its body is
|
data/docs/pages.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Pages: scripts that say what to show
|
|
2
|
+
|
|
3
|
+
A page is a Ruby script that gets its data any way a script can (another program's `--format json`, a file, the
|
|
4
|
+
session files) and hands rows and text to `ui`. `chi page run NAME` runs it and stores what it built; what shows a
|
|
5
|
+
page draws from that stored result, so showing it runs nothing. Pages run from the terminal and show in chi web, where
|
|
6
|
+
Refresh runs them again ([In chi web](#in-chi-web)).
|
|
7
|
+
|
|
8
|
+
**A page is code you trust.** It runs as you, with your files and your network, like any Ruby script chi writes for
|
|
9
|
+
you. There is no sandbox.
|
|
10
|
+
|
|
11
|
+
## Asking chi for a page
|
|
12
|
+
|
|
13
|
+
Say what you want to see and that you want it kept: "make me a page of …", "I'd like to reopen this in the web: …",
|
|
14
|
+
"keep this as a page". chi follows its shipped pages skill (`skill_pages`, [docs/memory.md](memory.md#skills)): it
|
|
15
|
+
finds the pages folder with `chi self`, writes `NAME.rb` there, runs `chi page run NAME`, compares the stored rows
|
|
16
|
+
with where they came from, fixes what failed, and answers in a line or two with the link `[Title](#/p/NAME)` (with
|
|
17
|
+
Markdown off, the link is plain text: the page is in All sessions, under Pages). "Change the page …" edits the script
|
|
18
|
+
and runs it again; "remove the page …" is `chi page rm NAME`.
|
|
19
|
+
|
|
20
|
+
- It uses `chi page list`, the read tool, `chi page run` and `chi page rm`, never a shell command that names the pages
|
|
21
|
+
folder (those ask you, and a turn nobody watches stops there).
|
|
22
|
+
- **Strict mode** (`guardrails.mode: strict`): writing the script asks (`write-outside-repo`: you, or whoever may
|
|
23
|
+
answer for the session, such as a parent agent or System 1); if it is denied, chi says so and stops.
|
|
24
|
+
- A participant's turn ([chi share](cli.md)) can't write chi's config folder or run chi commands: a page asked for
|
|
25
|
+
there is refused.
|
|
26
|
+
|
|
27
|
+
## A page
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
# ~/.config/samagotchi/pages/usage.rb
|
|
31
|
+
page "Usage, last 7 days" do |ui|
|
|
32
|
+
data = JSON.parse(`chi-usage --days 7 --format json`)
|
|
33
|
+
ui.text "Stored cost per model. #{data["totals"]["turns"]} turns."
|
|
34
|
+
ui.table data["groups"].map { |model, g| g.merge("model" => model) },
|
|
35
|
+
columns: { "model" => "Model", "turns" => "Turns", "cost" => "Stored" },
|
|
36
|
+
format: { "cost" => :money }, key: %w[turns cost],
|
|
37
|
+
total: { "model" => "Total", "turns" => data["totals"]["turns"], "cost" => data["totals"]["cost"] }
|
|
38
|
+
end
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
$ chi page run usage
|
|
43
|
+
page usage: "Usage, last 7 days" (0.4 s)
|
|
44
|
+
- text: Stored cost per model. 412 turns.
|
|
45
|
+
- table, 3 rows, columns: Model, Turns, Stored
|
|
46
|
+
claude:sonnet-5-5 | 96 | $14.2210
|
|
47
|
+
openrouter:deepseek-v4 | 141 | $3.9042
|
|
48
|
+
splash:qwen3.8-flash-next | 175 | $0.0000
|
|
49
|
+
total: Total | 412 | $18.1252
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The file is `NAME.rb` under `~/.config/samagotchi/pages/` (`$XDG_CONFIG_HOME/samagotchi/pages/`). A name is lowercase
|
|
53
|
+
letters, digits and hyphens, a letter or a digit first, at most 40. `json` is loaded; `require` anything else you use.
|
|
54
|
+
|
|
55
|
+
## What `ui` takes
|
|
56
|
+
|
|
57
|
+
A script calls `page "Title" do |ui| … end` once: a second call, or none, fails the run. The blocks show in the order
|
|
58
|
+
the script adds them, at most 20.
|
|
59
|
+
|
|
60
|
+
- **`ui.text(markdown)`**: a text block, Markdown. At most 16 KB.
|
|
61
|
+
- **`ui.table(rows, columns:, format: {}, key: nil, total: nil)`**: a table.
|
|
62
|
+
- `rows`: a list of Hashes (string or symbol keys). At most 500 are kept; the rest are dropped and the page says how
|
|
63
|
+
many.
|
|
64
|
+
- `columns:` (required) a Hash `key => label` in the order to show, or a list of keys (the label is the key). At most
|
|
65
|
+
12.
|
|
66
|
+
- `format:` `key => :money` (`$14.2210`) or `:count` (`1.2k`, `3.4M`). Nothing else: format other columns as text
|
|
67
|
+
yourself. The stored cell stays the number, so the column still sorts as numbers.
|
|
68
|
+
- `key:` the columns a phone shows before a row is opened, besides the first column, which always shows. Without it:
|
|
69
|
+
the first two columns whose cells are all numbers or empty.
|
|
70
|
+
- `total:` a Hash by column key, shown as a last row.
|
|
71
|
+
- A cell: a number stays a number, `nil` shows blank (`—` in the terminal), `true`/`false` stay, anything else is
|
|
72
|
+
its text (NaN and Infinity too). A cell over 300 characters is cut with `…`.
|
|
73
|
+
- **`ui.walk(title:, actors:, steps:)`** (or one Hash): a scenario walk, the same data and rules as a `chi-ui` walk in
|
|
74
|
+
an answer ([inline widgets](internals/inline-widgets.md#the-schemas)), drawn by the same widget. A walk the schema
|
|
75
|
+
refuses fails the run with its reason.
|
|
76
|
+
|
|
77
|
+
A rule broken fails the run with a message naming the block and the limit: `table 2: column "cost" has format
|
|
78
|
+
:percent (use :money or :count)`, `table 1 has 13 columns (at most 12)`.
|
|
79
|
+
|
|
80
|
+
## Running
|
|
81
|
+
|
|
82
|
+
- `chi page run NAME` runs the script in a Ruby process of its own and prints a summary of each block: a text's first
|
|
83
|
+
lines, a table's labels, first rows and total, a walk's step count. `--format json` prints the stored page.
|
|
84
|
+
- A run that fails (the script raised, has a syntax error, called `exit`, broke a limit, or printed more than 256 KB of
|
|
85
|
+
blocks) prints `error: line 9: undefined method 'fetch' for nil`, the last lines of what the script wrote to stderr,
|
|
86
|
+
and exits 1. **The result of the last good run is kept**: a bad edit never blanks the page.
|
|
87
|
+
- A run still going at **30 s** is stopped, with everything it started; the error says so. If what started the run
|
|
88
|
+
dies first (a killed terminal or chi web), the run stops itself a few seconds after its 30 s and records the same
|
|
89
|
+
error. Its output then has nowhere to go: a script that prints a lot may fail with `Broken pipe` instead (the last
|
|
90
|
+
good result is kept).
|
|
91
|
+
- One run of a page at a time: a second `chi page run usage` meanwhile exits 1 with `page usage is already running`.
|
|
92
|
+
- `chi page list` shows each page's title and `ran 2 min ago`, `failed 1 h ago (line 9)` or `(never ran)`, with
|
|
93
|
+
`changed` when the script changed since its result was made (the result came from an older script; nothing ran). `chi page rm NAME` removes the script and its result.
|
|
94
|
+
|
|
95
|
+
Exit codes: 0 ran, 1 failed (or no such page, or already running), 2 the command line itself (an unknown flag, a name
|
|
96
|
+
that breaks the rule). See [the CLI](cli.md#commands).
|
|
97
|
+
|
|
98
|
+
## In chi web
|
|
99
|
+
|
|
100
|
+
- **Finding a page.** All sessions has a **Pages** group at its top, in every project scope (pages are global): one row
|
|
101
|
+
of cards that scrolls sideways, each with the page's title and `ran 2 min ago`, `failed 1 h ago` or `never ran`. The
|
|
102
|
+
search field filters it too, by name and title. With no page (or none the search matches) there is no group. A
|
|
103
|
+
`#/p/usage` link in chi's answer opens the page in the same tab; a reload or a copied `…/#/p/usage` link opens it
|
|
104
|
+
too.
|
|
105
|
+
- **The page** shows in place of the session area: Back (to where it was opened from, else All sessions), the title,
|
|
106
|
+
when it ran and how long it took, **Refresh** and `⋯` with Delete (it asks once, then removes the script and its
|
|
107
|
+
result). Opening it shows the stored result at once and runs nothing.
|
|
108
|
+
- **Refresh** runs the script as `chi page run` does and redraws when the run ends; the button reads "Running…" and
|
|
109
|
+
can't be pressed twice. A run already going (from a terminal, another tab) says "already running". Stopping chi web
|
|
110
|
+
stops a Refresh. A Refresh holds its request until the run ends, up to about 32 s (the 30 s cut and its grace): behind
|
|
111
|
+
an auth proxy ([configuration.md](configuration.md#behind-an-auth-proxy)), its timeout must allow that.
|
|
112
|
+
- **A failed run** keeps the last result, dimmed, under "The script failed at line 9: … Showing the result from 21
|
|
113
|
+
Nov, 14:02." with **Copy the error** (the line, the message and the script's last words on stderr).
|
|
114
|
+
- **The script changed** since the result on screen was made: a line says so; nothing has run. "Changed" means the
|
|
115
|
+
result came from an older script.
|
|
116
|
+
- **A table**: a column header sorts by it (numbers as numbers, blanks last, the total stays at the bottom); a wide
|
|
117
|
+
table scrolls sideways in its own box. On a phone each row shows the first column and the key columns (`key:`);
|
|
118
|
+
a tap opens the rest as label and value lines; rows keep the script's order there.
|
|
119
|
+
- **A walk** is drawn by the same widget as in an answer; its lanes scroll sideways inside it.
|
|
120
|
+
- **Markdown off** (`web.markdown`, the default): a text block shows as plain text, and a link in chi's answer is plain
|
|
121
|
+
text too, so the Pages group is the way in. A fenced block inside a text block (a `chi-ui` or a mermaid one) stays
|
|
122
|
+
source on a page.
|
|
123
|
+
- **Not live**: the group is read when All sessions opens, a page when it opens and after its own Refresh or Delete.
|
|
124
|
+
A run from a terminal shows after the next open or a reload.
|
|
125
|
+
- Pages are the owner's: a participant ([chi share](cli.md)) sees no Pages group, no page, and no page route answers
|
|
126
|
+
their link.
|
|
127
|
+
|
|
128
|
+
## Where a run happens
|
|
129
|
+
|
|
130
|
+
- **The working folder is the pages folder.** A chi command a script runs sees that folder's project: if
|
|
131
|
+
`~/.config` sits in a git repository, that repository. Pass `--scope=all` to the session commands
|
|
132
|
+
(`chi sessions list --scope=all --format json`) for every project.
|
|
133
|
+
- **The environment is yours**, as a session's worker gets it: the XDG folders absolute, chi's own session markers and
|
|
134
|
+
guardrails settings left out, and `PWD` the pages folder; chi web's Refresh runs chi web's own chi. `CHI_REMOTE`, a worker's `SAMAGOTCHI_WORKER_*` keys and
|
|
135
|
+
the agent markers (`CLAUDECODE`, `CODEX_THREAD_ID`, `AI_AGENT`) are left out too: a run is always on this machine,
|
|
136
|
+
and a `chi send` from a script is yours, even when chi was started from an agent's pane. Name `chi` plainly; name other programs by absolute path:
|
|
137
|
+
a Refresh in chi web runs with chi web's `PATH`, which may not be your shell's.
|
|
138
|
+
- What the script prints to stdout is its own: the result goes through the stored file. Its stderr shows under a
|
|
139
|
+
failure.
|
|
140
|
+
- **A child that leaves the process group survives the 30 s cut** (a `setsid` or a daemon). A program the script
|
|
141
|
+
starts (`spawn`, `system`, backticks) never keeps the page "already running"; a Ruby `fork` (or `Process.daemon`)
|
|
142
|
+
that lives on does, until it ends. A script that `exec`s another program hands the run to it: the 30 s cut still
|
|
143
|
+
applies, but if what started the run dies, nothing stops that program. Anything that stays in the group is stopped.
|
|
144
|
+
|
|
145
|
+
## Where things are stored
|
|
146
|
+
|
|
147
|
+
- The script: `~/.config/samagotchi/pages/NAME.rb`.
|
|
148
|
+
- The result: `~/.local/state/samagotchi/pages/NAME/output.json` (`$XDG_STATE_HOME`): the title, the blocks of the last
|
|
149
|
+
good run, when it ran, how long it took, the sha256 of the script that made it, and the last failure since, if any.
|
|
150
|
+
Its shape is in [internals/pages.md](internals/pages.md).
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: samagotchi-system
|
|
3
|
-
version: 0.
|
|
3
|
+
version: 0.187.0
|
|
4
4
|
scope: system
|
|
5
5
|
description: Default system memories — identity, self map, config modification protocol, memory guide and the delegated-session rules
|
|
6
6
|
files:
|
|
7
7
|
identity.md: sha256:29c2f7df9f6c5acbc5ec17000a4490741e55e426af15ca0d81c8706edd9bd027
|
|
8
|
-
self_map.md: sha256:
|
|
8
|
+
self_map.md: sha256:c46fefc568b9b57c907ecc04f34b181dcc92d1cbcc40ef878a66b3973d79792f
|
|
9
9
|
config_modification_protocol.md: sha256:03fdf3ea3138449bc73f73eaa5604cc5d702777c20499ec13ca32b7696e6d37f
|
|
10
10
|
memory_guide.md: sha256:272443ff8292631b28239cb8431d6e8dd19aa23fc53d05e1a10c11696a0a5d8d
|
|
11
11
|
delegated.md: sha256:a0d6ddcd4a8be06526d964898611775fd251cfd9d145a9d16afaccaa503597bd
|
|
12
|
+
skill_pages.md:
|
|
13
|
+
sha256: sha256:be6071ce6195ffb3c8340cb458fd5d181f9ef86c87bda44b840f7bf066648478
|
|
14
|
+
description: "Make, change or remove a page in chi web (a table, text or a walk the user reopens at #/p/NAME): write the script, chi page run, check, link"
|
|
@@ -70,6 +70,10 @@
|
|
|
70
70
|
tell the user to restart the session. The plugin API: `docs/plugins.md`; what each shipped bundle does: `docs/bundles.md`. Writing one: read
|
|
71
71
|
`docs/bundle-authoring.md` in my source dir first.
|
|
72
72
|
|
|
73
|
+
- Pages: `chi page run|list|rm` runs, lists and removes pages, Ruby scripts in the `pages/` folder beside the
|
|
74
|
+
config file whose stored result chi web shows at `#/p/NAME`; how I make one is the `skill_pages` memory
|
|
75
|
+
(`docs/pages.md`).
|
|
76
|
+
|
|
73
77
|
An MCP host or a script can drive me: `docs/mcp-server.md`, `docs/thin-clients.md`.
|
|
74
78
|
|
|
75
79
|
## Where things live (relative to the source dir)
|
|
@@ -89,7 +93,7 @@ An MCP host or a script can drive me: `docs/mcp-server.md`, `docs/thin-clients.m
|
|
|
89
93
|
- When asked about my limits, flags, defaults or behavior: `rg` my source dir and cite
|
|
90
94
|
`file:line`. Read the source `chi self` reports, not some other checkout on disk.
|
|
91
95
|
- Installed gem files and bundled memories (`identity`, `memory_guide`,
|
|
92
|
-
`config_modification_protocol`, `self_map`, `delegated`) are managed: don't edit them
|
|
96
|
+
`config_modification_protocol`, `self_map`, `delegated`, `skill_pages`) are managed: don't edit them
|
|
93
97
|
(an upgrade merges local edits when it can, and a real conflict leaves the file behind).
|
|
94
98
|
Put notes in my own memories. Guidance for some models only is a model note
|
|
95
99
|
(`model_notes_<name>`, first line `models: <glob>`; memory_guide); a model-only
|