samagotchi 0.166.0 → 0.168.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 +89 -1
- data/docs/architecture.md +1 -0
- data/docs/cli.md +24 -15
- data/docs/configuration.md +1 -0
- data/docs/guardrails.md +5 -5
- data/docs/hooks.md +4 -6
- data/docs/internals/bundles.md +2 -4
- data/docs/internals/engine.md +4 -5
- data/docs/internals/objectives.md +141 -9
- data/docs/internals/remote-sessions.md +5 -6
- data/docs/internals/web-frontend.md +85 -40
- data/docs/memory.md +1 -2
- data/docs/sessions.md +20 -2
- data/docs/testing.md +3 -3
- data/lib/samagotchi/bridge.rb +1 -1
- data/lib/samagotchi/bundle_command/installed_check.rb +2 -14
- data/lib/samagotchi/bundle_command.rb +35 -12
- data/lib/samagotchi/bundles/system/manifest.yml +1 -1
- data/lib/samagotchi/cli/command.rb +10 -0
- data/lib/samagotchi/compat.rb +1 -13
- data/lib/samagotchi/config.rb +3 -0
- data/lib/samagotchi/context_command.rb +2 -1
- data/lib/samagotchi/engine/objectives.rb +20 -1
- data/lib/samagotchi/engine/side_requests.rb +3 -2
- data/lib/samagotchi/engine/turn_end.rb +4 -1
- data/lib/samagotchi/engine.rb +3 -0
- data/lib/samagotchi/extension_load.rb +2 -26
- data/lib/samagotchi/guardrails/approvals.rb +15 -16
- data/lib/samagotchi/jsonl_store.rb +61 -0
- data/lib/samagotchi/memory_bundle/status.rb +3 -15
- data/lib/samagotchi/memory_bundle/system_bundle.rb +16 -10
- data/lib/samagotchi/memory_command.rb +4 -2
- data/lib/samagotchi/objectives.rb +43 -14
- data/lib/samagotchi/objectives_backing.rb +124 -0
- data/lib/samagotchi/objectives_check.rb +19 -126
- data/lib/samagotchi/objectives_command.rb +14 -7
- data/lib/samagotchi/objectives_record.rb +104 -0
- data/lib/samagotchi/objectives_track.rb +353 -0
- data/lib/samagotchi/push_command.rb +2 -1
- data/lib/samagotchi/remote_command.rb +2 -1
- data/lib/samagotchi/reply_wait/poll.rb +6 -6
- data/lib/samagotchi/reply_wait.rb +4 -24
- data/lib/samagotchi/schedule_command.rb +6 -0
- data/lib/samagotchi/schedules.rb +1 -1
- data/lib/samagotchi/session_access/remote.rb +3 -5
- data/lib/samagotchi/session_commands.rb +1 -1
- data/lib/samagotchi/sessions_command.rb +12 -6
- data/lib/samagotchi/share_command.rb +2 -1
- data/lib/samagotchi/tool_activity.rb +11 -1
- data/lib/samagotchi/tool_declarations.rb +5 -1
- data/lib/samagotchi/tools/objectives_tool.rb +19 -2
- data/lib/samagotchi/turn_stages/objectives.rb +46 -3
- data/lib/samagotchi/version.rb +1 -1
- data/lib/samagotchi/web/participant_access.rb +1 -1
- data/lib/samagotchi/web/public/app.js +52 -424
- data/lib/samagotchi/web/public/copy.js +2 -1
- data/lib/samagotchi/web/public/dock_reserve.js +12 -2
- data/lib/samagotchi/web/public/history_end.js +16 -0
- data/lib/samagotchi/web/public/index.html +74 -22
- data/lib/samagotchi/web/public/info_bar_model.js +3 -1
- data/lib/samagotchi/web/public/no_contact_fill.js +29 -0
- data/lib/samagotchi/web/public/objectives.css +14 -0
- data/lib/samagotchi/web/public/objectives_moves.js +82 -9
- data/lib/samagotchi/web/public/objectives_state.js +42 -0
- data/lib/samagotchi/web/public/objectives_strip.js +33 -9
- data/lib/samagotchi/web/public/objectives_track.js +52 -0
- data/lib/samagotchi/web/public/objectives_wiring.js +16 -1
- data/lib/samagotchi/web/public/participant.html +1 -1
- data/lib/samagotchi/web/public/participants_panel.js +14 -7
- data/lib/samagotchi/web/public/question_cards.js +8 -13
- data/lib/samagotchi/web/public/refs.js +4 -1
- data/lib/samagotchi/web/public/reload_check.js +5 -4
- data/lib/samagotchi/web/public/resync_reach.js +10 -6
- data/lib/samagotchi/web/public/scope.js +3 -3
- data/lib/samagotchi/web/public/session_rename.js +6 -2
- data/lib/samagotchi/web/public/session_state.js +1 -1
- data/lib/samagotchi/web/public/session_sync.js +249 -0
- data/lib/samagotchi/web/public/session_view.js +279 -0
- data/lib/samagotchi/web/public/stage_cards.js +20 -0
- data/lib/samagotchi/web/public/stage_frame.js +14 -16
- data/lib/samagotchi/web/public/stage_model.js +11 -4
- data/lib/samagotchi/web/public/stage_opened.js +229 -0
- data/lib/samagotchi/web/public/stage_slots.js +2 -3
- data/lib/samagotchi/web/public/stage_view.js +219 -147
- data/lib/samagotchi/web/public/stage_watch.js +8 -4
- data/lib/samagotchi/web/public/stream_handlers.js +1 -1
- data/lib/samagotchi/web/public/tokens.css +2 -2
- data/lib/samagotchi/web/public/turn_block.js +22 -2
- data/lib/samagotchi/web/public/turn_html.js +1 -1
- data/lib/samagotchi/web/public/widget_picks.js +3 -0
- data/lib/samagotchi/web/public/working_set_view.js +1 -1
- data/lib/samagotchi/web/session_access_routes.rb +4 -15
- metadata +13 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6bc9c5e654d2f08b834fbfac7be6b27f308a4a5c0753fe1c2472ef73e2b7c38a
|
|
4
|
+
data.tar.gz: 44d7d0b2790f7182625a876b45e5e3172f41ce4cadd41209df3b7851f8b9d725
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e1424a5719445c61ac2a1904bb4cd6b097b7f7426b3bcfb1c7454f912edc2c14bda5a2574de21fb00f3ed3610e7ebaae2fe3bb3684fbc7f7b7f5c694115f7726
|
|
7
|
+
data.tar.gz: 9fa6dba73441bad02e5f278c374208bb9e7aef298c4b23413a3a367d7190234e935d091bfb4b511978568ed7c68edc41ff539557bcd136a18a9026e95b11d930
|
data/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,92 @@ and commands may change between minor versions. How releases are made:
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.168.0] - 2026-11-11
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Stored approvals from chi 0.166 and before (a list in `guardrails/approvals.json`) are no longer read: such a file is
|
|
16
|
+
set aside as `approvals.json.corrupt-*` and those calls ask again once.
|
|
17
|
+
- chi web: when the model asks its own question after a reply, the reply is a bubble in the conversation (`chi · step N
|
|
18
|
+
· asking you`) and the stage keeps only the question's card above the composer, so you can scroll back through the
|
|
19
|
+
conversation while it waits; the turn's prompt and steps move into the conversation with it, and the card's
|
|
20
|
+
`↑ its reason` leads back to the reply. Answered, the card sits under the reply; when the turn ends the reply folds
|
|
21
|
+
into the card's two lines as before. The same after a reload while the card waits or after it was answered. The
|
|
22
|
+
question's own room and its `❓ Answer ↓` pill are gone. Approvals, relayed and hook questions are unchanged.
|
|
23
|
+
- chi web: in a session the running turn's stage and the composer are as wide as the conversation's column (at most
|
|
24
|
+
960 px, centred, and clear of an always-shown scrollbar), so a wide window no longer draws them wider than the
|
|
25
|
+
messages above.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- chi web: after a reload mid-turn, a question answered earlier in the running turn keeps the reply that asked it (its
|
|
30
|
+
two muted lines), as it does live.
|
|
31
|
+
- chi web: the opt-in reload check (`web.reload_check`) no longer reports every turn with a question as different.
|
|
32
|
+
- `chi bundle list`, `status` and `diff`: an extra argument is refused (exit 2) instead of ignored.
|
|
33
|
+
|
|
34
|
+
Update with `chi update`, then restart chi web and running sessions (`chi sessions restart`).
|
|
35
|
+
|
|
36
|
+
## [0.167.0] - 2026-11-11
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- Objectives: a move says where its objective stands, `progress` (the default), `blocked` or `done` (the `objectives`
|
|
41
|
+
tool's new `state`). `/objectives` and the web's move line and list say "claims done" or "blocked" beside the move;
|
|
42
|
+
a done move is the agent's claim, and you still mark the objective done yourself.
|
|
43
|
+
- Objectives: a done move whose own turn's last command failed, or that edited files again after a command checked its
|
|
44
|
+
edits, is marked `not backed: …` under it (muted, in `/objectives` and the web), read from the turn's runs by chi,
|
|
45
|
+
not the model.
|
|
46
|
+
- chi web: the newest turn that edited, wrote or ran a command and recorded no move on the objectives says `no move
|
|
47
|
+
recorded` under its steps, while the list has an active objective (not for a canceled or failed turn, nor a
|
|
48
|
+
participant's).
|
|
49
|
+
- Objectives: the tracker, `/objectives track`: one side request reads the session's record and says where each active
|
|
50
|
+
objective stands (`done`, `progress`, `blocked` or `no sign`, with what in the record shows it), as a card and as
|
|
51
|
+
`track: …` under each objective, beside the agent's own moves; in chi web, "Where are we?" at the list's foot and on
|
|
52
|
+
the `no move recorded` line. Information only, on `objectives.check_model`, at most
|
|
53
|
+
8 objectives per read. `objectives.tracker: on` (default `off`) also runs it by itself after a turn of yours that did
|
|
54
|
+
work and recorded no move; your next turn cancels it. With a hosted `check_model` that sends the session's record off
|
|
55
|
+
the machine after such a turn, without a tap.
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- The `objectives` tool's schema has a new optional `state` (on `full`, the coordinator kit, and among the deferred
|
|
60
|
+
tools on Anthropic's wire): a one-time change of the request's tools block, so the first request after the upgrade
|
|
61
|
+
doesn't reuse the prompt cache's tool prefix. A session with no objectives list sees no other change.
|
|
62
|
+
- Guardrails: approvals.json is now written versioned (`{"version", "approvals"}`), and a list file from 0.166 or
|
|
63
|
+
before is rewritten versioned on its first read. Sessions still on 0.165 or older should be restarted
|
|
64
|
+
(`chi sessions restart`); a downgrade to 0.165 or older sets the store aside as a recoverable
|
|
65
|
+
`approvals.json.corrupt-*` file.
|
|
66
|
+
- Bundles: an install record from 0.157 with class-file hooks is no longer announced (at the first turn, in
|
|
67
|
+
`chi bundle status` or in `chi update`); its hooks still don't load. Reinstall or upgrade the bundle to clear them.
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
|
|
71
|
+
- Web: the Invite form's note on binding a link says "their account", as its field and `chi share --identity` do,
|
|
72
|
+
not "their email".
|
|
73
|
+
- chi web on iPhone: no text field gets Safari's "AutoFill Contact" bar any more (the composer, the all view's search,
|
|
74
|
+
the rename field, and the composer after a picks note or the invite form has been shown).
|
|
75
|
+
- chi web's top bar: the all-sessions header (search, count, archived, Select) moves to a line of its own with the bell
|
|
76
|
+
where it doesn't fit beside the sessions pill (about 601-760px wide) instead of covering the pill's end; on a phone the
|
|
77
|
+
project chip cuts its name with an ellipsis rather than pushing "all" under the pill (a 320px start page with the strip
|
|
78
|
+
hidden).
|
|
79
|
+
- chi web: when the page can't reach chi web, the session bar's status chip says "retrying", then "offline" (the full
|
|
80
|
+
words in its tooltip) instead of "reconnecting…" / "can't reach chi web", so the bar no longer shifts; during a running
|
|
81
|
+
turn only the stage says "reconnecting…" and the chip keeps "running".
|
|
82
|
+
- chi web on a phone: the status bar takes the top bar's tint (the theme-color under 600px wide is the colour the page's
|
|
83
|
+
top edge starts with, and the page's accent tint now runs down from that edge), so there is no seam between them in
|
|
84
|
+
the Home Screen app or a Safari tab, light or dark.
|
|
85
|
+
- `chi schedule add --date`: a day the month doesn't have (2026-02-30, 2026-04-31) is refused as not a real date
|
|
86
|
+
instead of rolling into the next month.
|
|
87
|
+
- `chi sessions list`: an unknown `--sort` or `--order` value is refused (exit 2, naming the ones it takes) instead of
|
|
88
|
+
listing in the default order under a footer that names the bogus value.
|
|
89
|
+
- `chi schedule list` and `chi schedule tick`: a `--format` other than `text` or `json` is refused (exit 2), as the
|
|
90
|
+
other commands' `--format` is, instead of printing text; `tick` fires nothing then.
|
|
91
|
+
- `chi bundle status`, `diff` and `list`: an unknown flag is refused (exit 2) as for `install`, instead of being dropped
|
|
92
|
+
and its value read as the bundle's name (`chi bundle status --format json` looked for a bundle `json`); `--help`
|
|
93
|
+
prints their usage.
|
|
94
|
+
|
|
95
|
+
Update with `chi update`, then restart chi web and running sessions (`chi sessions restart`).
|
|
96
|
+
|
|
11
97
|
## [0.166.0] - 2026-11-11
|
|
12
98
|
|
|
13
99
|
### Added
|
|
@@ -6153,7 +6239,9 @@ and long-lived sessions.
|
|
|
6153
6239
|
- A macOS desktop helper (`chi desktop install`): a "Send to chi" Service and a
|
|
6154
6240
|
hotkey panel that send selected text or the clipboard to your sessions.
|
|
6155
6241
|
|
|
6156
|
-
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.
|
|
6242
|
+
[Unreleased]: https://github.com/dm1try/samagotchi/compare/v0.168.0...HEAD
|
|
6243
|
+
[0.168.0]: https://github.com/dm1try/samagotchi/compare/v0.167.0...v0.168.0
|
|
6244
|
+
[0.167.0]: https://github.com/dm1try/samagotchi/compare/v0.166.0...v0.167.0
|
|
6157
6245
|
[0.166.0]: https://github.com/dm1try/samagotchi/compare/v0.165.0...v0.166.0
|
|
6158
6246
|
[0.165.0]: https://github.com/dm1try/samagotchi/compare/v0.164.0...v0.165.0
|
|
6159
6247
|
[0.164.0]: https://github.com/dm1try/samagotchi/compare/v0.163.0...v0.164.0
|
data/docs/architecture.md
CHANGED
|
@@ -104,6 +104,7 @@ terminal renders the events it gets over the Bridge.
|
|
|
104
104
|
| Turn | `TurnContext`, `TurnState`, `Engine::Turn` | One turn's frozen `TurnContext` (id, session, origin, author, participant mode, controller, folders, git facts, settings, model key/name and the tool surface (`Tools::ToolSurface`) from `generate`): built by `Engine#begin_turn`, published with the running flag by `TurnState` (the only way another thread reads the running turn: `Engine#turn_context` / `#last_turn_context`), handed explicitly down the tool path (`ModelBackend#complete(context:)`, `ToolRunner#run`, `Guardrails::Gate#evaluate`, `KernelLoop#dispatch_tool_call`). `Engine::Turn` keeps only the lifecycle state ([internals/engine.md](internals/engine.md), "Turn and TurnContext"). The turn stages (`TurnStages::ToolkitSuggestion`, `TurnStages::ContextJudge`, `TurnStages::Objectives`, `TurnStages::Warmup`, `TurnStages::VerifyAnchors`, `lib/samagotchi/turn_stages/`): the steps that keep state across the turn, built from the Engine-lifetime objects and called by name from the turn's skeleton with the values of the call (a `SystemOne::Recorder`, the sessions dir), not callbacks into the Engine (internals/engine.md, "Turn stages"). |
|
|
105
105
|
| Adapters | `Samagotchi::Client`, `LLM::OpenAIChat`, `LLM::AnthropicMessages`, `LLM::HTTP` | Raw-prompt servers, the OpenAI chat API, Anthropic's Messages API, and the HTTP they share. |
|
|
106
106
|
| Tools | `lib/samagotchi/tools/*` | Execute, read, edit, write, memory, task_*, web_fetch, delegate/delegate_result, ask_user_question, reminders, send_note, list_sessions, context_read, objectives, forget_outputs, find_tools/call_tool (the tool index), plus runtime/output-guardrails. |
|
|
107
|
+
| Objectives | `Objectives` (`objectives.rb`, `objectives_backing.rb`, `objectives_edit.rb`), `ObjectivesCommand`, `ObjectivesRecord`, `ObjectivesCheck`, `ObjectivesTrack`, `ObjectivesAudit`, `TurnStages::Objectives` | The session's list (a note), the model's moves and their backing, `/objectives`, and the side readers of the record: Check this, the tracker, System 1's audit. See [internals/objectives.md](internals/objectives.md). |
|
|
107
108
|
| Bundles | `lib/samagotchi/memory_bundle/*`, `BundleCommand` | `chi bundle`: install/upgrade (3-way, with a text merge of edited memories), build, uninstall; the install record under `.bundles/<name>/` that the guardrail and plugin loaders read ([internals/bundles.md](internals/bundles.md)). |
|
|
108
109
|
| Background | `Samagotchi::Worker`, `Samagotchi::SessionManager` | `SessionManager` (`session_manager.rb`, its parts in `session_manager/`: spawn · worker_command · listing · delivery · lifecycle · removal · emptiness) forks/spawns one worker process per session. The worker process's main (owner lock, detach, signals, project env, what it does as it leaves) is `WorkerBoot` (`worker_boot.rb`), which the boot string loads directly. Its `Worker` builds the `Engine` and `Bridge` (no terminal rendering) and runs queued turns. The spawned process (own process group) forks the worker, which `setsid`s and is reparented to init once its starter exits (it waits until the worker holds `owner.lock`, so the spawner's `Process.detach` waiter tells a starting worker): nothing that walks the spawner's process tree reaches it (`SAMAGOTCHI_WORKER_DETACH=1`, `detach_from_spawner`). The lock's pid is the worker's; `spawn`'s `child_pid` is its starter's. |
|
|
109
110
|
| Web | `Samagotchi::Web::App`, `Samagotchi::Web::Server`, `Samagotchi::Web::SessionHub` | Rack+WEBrick on one port, `127.0.0.1:4567` (index.html + `/api/*` + SSE); with `web.host: lan` also on this machine's LAN address, behind an access token (`Web::Lan`, `Web::Token`). The hub is chi web's projection of the session list, pushed to every tab over `GET /api/events`. |
|
data/docs/cli.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
- `chi web push ls [--format json]`, `chi web push rm ID`, `chi web push test [ID]` — the phones chi web pushes to (see [Phone notifications](configuration.md#phone-notifications-web-push)): list them (short id, label, origin, added, last delivery, done turns, last error; `stale` for one made on another public URL than chi web's now: never sent to), remove one, or send a test notification to ID or to every device not stale. chi web need not run; nothing printed holds a device's push address or keys. A usage error exits 2; a store others can read, a corrupt one, an unknown device or a failed test push exit 1. This machine only: `chi --remote X web push` exits 2
|
|
18
18
|
- `chi web --web-markdown` / `--no-web-markdown` — opt in to, or opt out of, sanitized Markdown rendering for completed assistant messages, the stage's asking text and a resolved question card's reply (`web.markdown`, off by default; `--no-web-markdown` turns a config's `web.markdown: true` off for this run)
|
|
19
19
|
- `chi web --no-web-working-set` — turns the stage view's working set off (on by default; `--web-working-set` turns a config's `web.working_set: false` back on): what each turn brought into the model's context, in the stage and under each finished turn; `?working_set=1|0` on the page URL overrides it (see [The working set](#the-working-set))
|
|
20
|
-
- `chi sessions list|stop|restart|archive|unarchive|delete|prune|clean|stats` — manage persisted sessions; `list` shows this git project's, `list --scope=all` every one, a delegated session with `↳ <parent>`, `list --archived` the archived ones too (see [Sessions](sessions.md)); one line per session (`<id> <state> <ctx> <updated_at> <text> [flags] ↳ … ↪ …`) and one footer (`N session(s) (sort=… order=…)`, or the project note) for the plain list, the `--live`/`--cwd` text and `--remote`. `stats ID` prints a session's cost, tokens and progress, and its own settings (`--set`; a `settings:` line), from a live worker's `GET stats`, else its saved `analytics.json` (`--format json` one object, with `settings`), without running a model turn. A usage error (an unknown subcommand or flag, a flag missing its value, `stop`, `restart` or `delete` with no ids, a bad `list --format` or `--
|
|
20
|
+
- `chi sessions list|stop|restart|archive|unarchive|delete|prune|clean|stats` — manage persisted sessions; `list` shows this git project's, `list --scope=all` every one, a delegated session with `↳ <parent>`, `list --archived` the archived ones too (see [Sessions](sessions.md)); one line per session (`<id> <state> <ctx> <updated_at> <text> [flags] ↳ … ↪ …`) and one footer (`N session(s) (sort=… order=…)`, or the project note) for the plain list, the `--live`/`--cwd` text and `--remote`. `stats ID` prints a session's cost, tokens and progress, and its own settings (`--set`; a `settings:` line), from a live worker's `GET stats`, else its saved `analytics.json` (`--format json` one object, with `settings`), without running a model turn. A usage error (an unknown subcommand or flag, a flag missing its value, `stop`, `restart` or `delete` with no ids, a bad `list --format`, `--scope`, `--sort` or `--order`, a `--days`, `--keep` or `--limit` that isn't a whole number) exits 2; an unknown or refused session exits 1
|
|
21
21
|
- `chi note [--source NAME] [-m TEXT] (ID|PREFIX)... | --all` — add a context note (TEXT or stdin) to sessions: background the model sees on its next turn; it starts no turn (see [Sessions: Context notes](sessions.md#context-notes))
|
|
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))
|
|
@@ -359,9 +359,8 @@ Also shipped, not installed: dev (mcp, skills, source-links) (chi bundle install
|
|
|
359
359
|
chi no longer fires, a `ctx`/`chi` call the API lacks, a reference to chi's
|
|
360
360
|
internals that this chi no longer has (`Samagotchi::OldInternal::Thing is gone from this chi, so this bundle may
|
|
361
361
|
fail` — a name that still resolves gets no row, so a bundle reaching `Samagotchi::Log` isn't warned about on every
|
|
362
|
-
update), a name chi now ships, a rule or plugin edited since it was installed (it
|
|
363
|
-
doesn't load)
|
|
364
|
-
NAME` once its source hooks from `plugin.rb`, or `chi bundle uninstall NAME`). What only an author can act on (shas, unlisted files, tests, a
|
|
362
|
+
update), a name chi now ships, or a rule or plugin edited since it was installed (it
|
|
363
|
+
doesn't load). What only an author can act on (shas, unlisted files, tests, a
|
|
365
364
|
missing `requires_chi`, its floor, `trust_level`) is left out, and so are
|
|
366
365
|
profiles. A clean bundle gets no row beyond its `skipped (not from chi)`.
|
|
367
366
|
- **They fail nothing:** an error row too has `failed: false` and leaves the exit
|
|
@@ -989,7 +988,8 @@ title (its strip card, or the top bar) does it. See [Session titles](sessions.md
|
|
|
989
988
|
|
|
990
989
|
<a id="session-objectives"></a>
|
|
991
990
|
`/objectives` shows what the session is to achieve, each objective's latest move under it (`last move: …`, recorded by
|
|
992
|
-
the model's `objectives` tool
|
|
991
|
+
the model's `objectives` tool; `last move: claims done: …` or `last move: blocked: …` for a move with that state, and under a done move its turn's
|
|
992
|
+
runs don't back, `not backed: the last command failed` or `not backed: edited after the last command ran`); [Objectives](sessions.md#objectives) has what that does.
|
|
993
993
|
- `/objectives set Two coffees | Stops before checkout (done when: no order is placed)`: a new list. Parts are split by
|
|
994
994
|
` | ` or by lines; a part may end `(done when: …)`. It replaces the list, and ids go on from the old one's.
|
|
995
995
|
- `/objectives add TEXT`: one more (several with ` | `).
|
|
@@ -999,6 +999,11 @@ the model's `objectives` tool); [Objectives](sessions.md#objectives) has what th
|
|
|
999
999
|
- `/objectives undo O1 [O2…]`: back to active, after a mistaken `done` or `drop`.
|
|
1000
1000
|
- `/objectives check O1`: an independent read of O1's latest move, one side request; the verdict comes as a card and as
|
|
1001
1001
|
`check: …` under the move. Information only: it edits nothing, and it is refused for an objective with no move or a dropped one, and during a participant's turn. See [Objectives](sessions.md#objectives).
|
|
1002
|
+
- `/objectives track`: the tracker, one side request reading the record for every active objective (at most 8); its
|
|
1003
|
+
lines come as a card and as `track: …` under each objective (`(stale)` once the objective changed or the conversation
|
|
1004
|
+
moved on), and the listing's first line says `(tracker: running)` while one runs. Information only; refused with no
|
|
1005
|
+
active objective and during a participant's turn. `objectives.tracker: on` runs it by itself too. See
|
|
1006
|
+
[Objectives](sessions.md#objectives).
|
|
1002
1007
|
|
|
1003
1008
|
All of them run mid-turn too. An edit answers with the new list at once and goes into the conversation between turns.
|
|
1004
1009
|
Refused while a `--non-interactive` run has the session, as `chi note` is.
|
|
@@ -1257,20 +1262,24 @@ the step's reasoning), the running tool with what it does, and the last
|
|
|
1257
1262
|
three calls. A plugin's or hook's notice and a plugin's nudge ("check-in
|
|
1258
1263
|
nudged the model") show ahead of those calls for about 4 s, as their rows
|
|
1259
1264
|
wait in the closed block. A card that needs you (a question, an approval, check-in)
|
|
1260
|
-
sits in the stage too.
|
|
1261
|
-
the
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
the
|
|
1266
|
-
|
|
1267
|
-
|
|
1265
|
+
sits in the stage too. When the model asks its own question after a reply,
|
|
1266
|
+
the turn moves into the conversation: your prompt, its steps (closed; they
|
|
1267
|
+
open in place) and the reply that asked, as a bubble labelled `chi · step N
|
|
1268
|
+
· asking you`, read from its first line; the stage keeps only the card, and
|
|
1269
|
+
the conversation scrolls freely behind it (the card's `↑ its reason` leads
|
|
1270
|
+
back to the reply). Answered, the card sits under that reply and the stage
|
|
1271
|
+
goes back to the running turn. While an approval, a delegate's relayed
|
|
1272
|
+
question or a hook's question waits, the stage shows the whole text of the
|
|
1273
|
+
reply that asked it (in place of its newest sentence) above the card, until
|
|
1274
|
+
you answer. Once answered, the model's
|
|
1268
1275
|
question or its own approval keeps that reply (a delegate's relayed
|
|
1269
1276
|
approval, a hook's question and the step limit don't): two muted lines
|
|
1270
1277
|
under its `question → answer` line, the whole text when you open the card,
|
|
1271
|
-
live and after a reload
|
|
1278
|
+
live and after a reload (the reply's bubble folds into those two lines when
|
|
1279
|
+
the turn moves into the history). The chip at the stage's bottom edge, `N steps · M tool
|
|
1272
1280
|
calls` with one tick per call, opens the turn block right above it (newest step first
|
|
1273
|
-
while it runs; a tick opens its step)
|
|
1281
|
+
while it runs; a tick opens its step); once a question moved the turn into the
|
|
1282
|
+
conversation, the chip and its ticks open the steps there instead, in order. Below the chip, past a dashed rule, wait the
|
|
1274
1283
|
messages queued for after the turn and the commands queued for its end; they go into
|
|
1275
1284
|
the history after the turn's answer. `▾` folds the stage to its status
|
|
1276
1285
|
row, remembered in this browser. The stage keeps its height while a turn
|
data/docs/configuration.md
CHANGED
|
@@ -2328,6 +2328,7 @@ column says so, a `--kebab-name` flag. The maps (`hosts:`, `models:`,
|
|
|
2328
2328
|
| `context.candidates.offer_threshold` | `0.6` | | The probability from which on mode shows the candidate's card, once (`would: offer`, below `threshold`). config.yml only. |
|
|
2329
2329
|
| `context.candidates.reask_after_turns` | `3` | | Owner prompts after a judged ask before the judge's one re-ask of that candidate. config.yml only. |
|
|
2330
2330
|
| `objectives.check_model` | none | | The model [Check this](sessions.md#objectives) asks, its one side request (a host:id, an alias, a host's model id); none: the session's own. **Each Check this sends that model's host up to 24,000 characters of the session's tool output, messages and the agent's visible answers, off the machine with a hosted model even from a local session;** known key shapes and `token=`-style values are redacted first, by pattern only. config.yml only. |
|
|
2331
|
+
| `objectives.tracker` | `off` | | `on`: [the tracker](sessions.md#objectives) also runs by itself after a turn of the owner's (a prompt or a wake; not a participant's, not a `--non-interactive` run) that had a successful edit, write or execute and recorded no move, while an objective is active, on `objectives.check_model`; the owner's next turn cancels a read still out. **Each such run sends that model's host up to 24,000 characters of the session's tool output, messages and the agent's visible answers, off the machine with a hosted model even from a local session, without a tap;** known key shapes and `token=`-style values are redacted first, by pattern only. `off` (the default): only `/objectives track` and the web's Where are we? run it. config.yml only. |
|
|
2331
2332
|
| `objectives.system_one` | `off` | | `audit`: System 1 answers a yes/no per active objective on what comes in and goes out, saved as runs and acted on by nothing; see [System 1's saved runs](system-one.md#objectives-in-audit). `off` (the default): no conversation text goes to a System 1 host for this. Its host and model are `system_one.host` / `.model`. config.yml only. |
|
|
2332
2333
|
| `toolkit.default` | `full` | | The toolkit a new session is stored on: the tools its prompts declare (`full`, `lean`, `child`, one of `toolkit.kits` or a bundle's). `chi --toolkit` picks one per session. See "Toolkits". |
|
|
2333
2334
|
| `toolkit.child` | `full` | | A delegate child's toolkit, unless its `delegate` call names one (`toolkit:`). See "Toolkits". |
|
data/docs/guardrails.md
CHANGED
|
@@ -114,10 +114,10 @@ answers it, since it is keyed on the whole command you saw: `git branch -D x &&
|
|
|
114
114
|
once, session and repo, while `git merge y && git push` offers once, as `git-merge` offers only once and its rule.
|
|
115
115
|
Two rules with one id (a config.yml copy of a bundle's rule) are one rule; a core ask followed by a rule's (the
|
|
116
116
|
[child boundary's](#a-delegate-childs-boundary)) keeps its own scopes.
|
|
117
|
-
The file is a
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
The file is a versioned store (`{"version": 1, "approvals": [...]}`, `Approvals::FORMAT`); a write keeps its version,
|
|
118
|
+
the keys this chi doesn't know and an entry with no `scope`. A bare list of entries, as chi 0.166 and before wrote it, is no longer read: it is set aside as
|
|
119
|
+
`approvals.json.corrupt-*` like an unreadable file, so those calls ask once more. Chi 0.165 and before set a versioned store aside, so restart their sessions
|
|
120
|
+
(`chi sessions restart`); a downgrade to 0.165 or before moves the store to a recoverable `approvals.json.corrupt-*`.
|
|
121
121
|
A file that doesn't parse, or a versioned store whose `approvals` isn't a list, is moved aside to
|
|
122
122
|
`approvals.json.corrupt-<UTC time>` with one warning, and chi starts with no stored approvals (more asks, nothing lost).
|
|
123
123
|
`/guardrails` lists the rules and approvals; `/guardrails revoke N` removes
|
|
@@ -1487,7 +1487,7 @@ else goes to chi's own rules. It needs nah installed; see its README for the set
|
|
|
1487
1487
|
that fails to load (missing, syntax error, an unmet `requires_chi`, or for a
|
|
1488
1488
|
plugin a sha256 that differs from the installed one) makes chi deny
|
|
1489
1489
|
every tool call. (An older chi's class-file bundle hooks don't load at all,
|
|
1490
|
-
`fail_closed` or not
|
|
1490
|
+
`fail_closed` or not, [hooks.md](hooks.md#class-file-hooks-are-retired).) A fail-closed hook that raises when called denies that call.
|
|
1491
1491
|
- Other hooks stay fail-open; a load failure is a warning.
|
|
1492
1492
|
- Every load failure is shown once, at the start of the first turn
|
|
1493
1493
|
(`guardrails> …` in the terminal, a red line on the web).
|
data/docs/hooks.md
CHANGED
|
@@ -632,7 +632,7 @@ stripped of surrounding whitespace, except file text, an edit's
|
|
|
632
632
|
| `delegate` | `task` | — | `model`, `session`, `cwd`, `toolkit`, `wait`, `timeout` |
|
|
633
633
|
| `delegate_result` | — | — | `session`, `timeout` |
|
|
634
634
|
| `ask_user_question` | `question` | — | `question`, `options`, `header`, `multi_select`, `allow_freeform` |
|
|
635
|
-
| `objectives` | `note` | — | `action`, `id`, `note`, `evidence`, `change`, `text` |
|
|
635
|
+
| `objectives` | `note` | — | `action`, `id`, `note`, `evidence`, `state`, `change`, `text` |
|
|
636
636
|
| `forget_outputs` | `note` | — | `ids`, `note`, `keep`, `restore` |
|
|
637
637
|
|
|
638
638
|
A `write`'s `content:` is the file text; an `edit` carries `old_text:` and
|
|
@@ -676,11 +676,9 @@ installs or loads them:
|
|
|
676
676
|
`--dry-run` too; `chi bundle check` reports it as `hooks-retired`. An empty
|
|
677
677
|
`hooks: {}` is fine.
|
|
678
678
|
- A bundle an older chi installed with hooks keeps its memories, rules, plugin
|
|
679
|
-
and scripts. Its hooks don't load
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
`Hooks (N): not loaded`, and `chi update` adds a `hooks-retired` row for a
|
|
683
|
-
bundle chi doesn't ship.
|
|
679
|
+
and scripts. Its hooks don't load, and nothing says so any more (chi 0.158 to
|
|
680
|
+
0.166 announced them at the first turn, in `chi bundle status` and in
|
|
681
|
+
`chi update`): reinstall or upgrade the bundle to clear them.
|
|
684
682
|
- The next install or upgrade from a source without hooks removes the old
|
|
685
683
|
`hooks/` (an edited hook, or a file the record doesn't know, is copied to
|
|
686
684
|
the trash first; a dev link never): `Removed (chi no longer loads
|
data/docs/internals/bundles.md
CHANGED
|
@@ -106,10 +106,8 @@ bundle, or a SyntaxError's own line), which `Install` maps from the installed co
|
|
|
106
106
|
back to the source dir.
|
|
107
107
|
|
|
108
108
|
Class-file hooks (retired). A record an older chi installed may still have a `hooks` map and `hooks/*.rb`
|
|
109
|
-
(`InstalledBundle#hooks`). Nothing loads them
|
|
110
|
-
|
|
111
|
-
`retired_hooks` gives `chi bundle status` its `Hooks (N): not loaded` lines (and the list an issue), and
|
|
112
|
-
`BundleCommand::InstalledCheck` a `hooks-retired` row for `chi update` (an `InstalledCopy` has no hooks). A source with
|
|
109
|
+
(`InstalledBundle#hooks`). Nothing loads them, and nothing announces them any more (the first turn, `chi bundle
|
|
110
|
+
status` and `chi update` did from 0.158 to 0.166). A source with
|
|
113
111
|
hooks is refused before its manifest is read (`Installer#refuse_hooks`, then `Manifest.read`), strict or not, a dry
|
|
114
112
|
run too; `ShippedUpdate`'s plan skips one the same way. Over such a record, `AssetInstaller#retire_hooks` (after the
|
|
115
113
|
plugin and scripts, so a refused install leaves them) copies every edited or unknown file under `hooks/` to the trash
|
data/docs/internals/engine.md
CHANGED
|
@@ -85,7 +85,7 @@ hook's model switch names the new model and `incoming` the old one. Building one
|
|
|
85
85
|
|---|---|---|---|---|
|
|
86
86
|
| `TurnStages::ToolkitSuggestion` (ToolkitSuggest's ask; configuration.md (Toolkits), guardrails.md (System 1)) | side judgments, host registry, toolkit binding, tools | `start(turn, recorder:)`; `settle`, `abandon(turn, why)`, `finish` (the turn); `warm!(session)` | `start` before `refresh_profile!`; `settle` after `apply_staged_tools!` (on mode: waits up to System 1's timeout or a Stop, which wins over an answer already in; a pick ≥ threshold → `ToolkitBinding#suggest`); `abandon` at STOP CHECK A and in the ensure, then `finish`; `warm!` / `stop_warmup` (Worker start, `shutdown`) | the turn's `ToolkitSuggest::Pending` (turn thread only; another turn's is never touched; dropped at `finish`), the warm-up thread |
|
|
87
87
|
| `TurnStages::ContextJudge` ([attached-context.md](attached-context.md), [context.md](../context.md) "The judge") | side judgments, host registry, `TurnState`, `show_card:`, `current_session:` | `start(turn, recorder:)`; `late_candidates(session, messages:, recorder:, state_dir:)`; `show_cards_after_turn` | `start` after `settle`, before `apply_toolkit!` (owner turns only); `late_candidates` from `judge_late_candidates` (which returns on no session or a review session first, before reading anything else); `show_cards_after_turn` after `release_turn` | the cards an answer brought while a turn ran, under their mutex |
|
|
88
|
-
| `TurnStages::Objectives` ([objectives.md](objectives.md)) | side judgments, host registry | `incoming(turn, recorder:)`, `outgoing(turn, result, recorder:)`, `note(session, note, recorder:, state_dir:)`, `announce(session, state_dir:, running:)` → the event or nil, `propose(proposal)`, `finally(turn)` → the cards | `incoming` after the judge's `start` (owner and human prompts only); `announce` from `announce_objectives` (inside `end_turn`'s step, and between turns from any thread); `outgoing` in `complete_turn` before `:after_turn
|
|
88
|
+
| `TurnStages::Objectives` ([objectives.md](objectives.md)) | side judgments, host registry | `incoming(turn, recorder:)`, `outgoing(turn, result, recorder:)`, `note(session, note, recorder:, state_dir:)`, `announce(session, state_dir:, running:)` → the event or nil, `propose(proposal)`, `finally(turn)` → the cards, `track(turn, engine:)` → the tracker's thread or nil, `cancel_track` | `cancel_track` first thing in `begin_turn` (any turn, a wake's too); `incoming` after the judge's `start` (owner and human prompts only); `announce` from `announce_objectives` (inside `end_turn`'s step, and between turns from any thread); `outgoing` in `complete_turn` before `:after_turn`, `track` right after it (`Engine#track_objectives_after`); `note` in `add_context_note`; `propose`; `finally` from `show_objective_proposals` in the ensure | the turn's proposals under their mutex (drained at `finally`), the last view announced (touched only under the event lock), the tracker's automatic read's cancel under its own mutex; the `ObjectivesAudit` is built per call |
|
|
89
89
|
| `TurnStages::Warmup` (PromptWarmup) | `PromptWarmup`, kernel, `TurnState`, model settings, reminder queue, `system_prompt` | `after(turn, result, next_turn_waiting:)` | after `complete_turn` (reads `turn.context.settings`) | none (PromptWarmup keeps its pin and thread) |
|
|
90
90
|
| `TurnStages::VerifyAnchors` | nothing | `verified(session, anchor, state_dir:)`; `stamp_opening`, `record_verdict` | `verified` in `begin_turn` (before any `TurnContext`); `stamp_opening`, `record_verdict` inside `end_turn`'s step | none |
|
|
91
91
|
|
|
@@ -648,9 +648,8 @@ re-validates them ([architecture.md](../architecture.md), the `display_refs` par
|
|
|
648
648
|
- **A hook that raises is logged; it never breaks the turn.** A plugin's `chi.on` handler also tells the user once
|
|
649
649
|
per label (`Hooks.wrap(on_failure:)` → `HookRoutes#plugin_hook_failed`: a `:guardrail_warning` labelled
|
|
650
650
|
`plugins`, through `Plugin::Registries#hook_failed`). A config hook has none, nor the test kit's sandbox.
|
|
651
|
-
- `ExtensionLoad#hooks` loads config.yml's hooks only; an installed record
|
|
652
|
-
|
|
653
|
-
([hooks.md](../hooks.md#class-file-hooks-are-retired)).
|
|
651
|
+
- `ExtensionLoad#hooks` loads config.yml's hooks only; an installed record's class-file bundle hooks (an older
|
|
652
|
+
chi's install) never load ([hooks.md](../hooks.md#class-file-hooks-are-retired)).
|
|
654
653
|
- A notice goes to the running turn's sink and the observers; outside a turn it is announced with
|
|
655
654
|
`between_turns: true`; while the plugins load it is held. `EventRoutes#route` decides it, the same routes as a card's
|
|
656
655
|
(`Engine#show_card`); a guardrails line after load takes only the turn / between-turns routes (`#route_by_turn`).
|
|
@@ -753,7 +752,7 @@ are in [architecture.md](../architecture.md)'s file table.
|
|
|
753
752
|
| `engine/model_settings.rb` | `Engine::ModelSettingsPart`: SessionModelSettings and EngineSnapshots, forwarded |
|
|
754
753
|
| `engine/events.rb` | `Engine::EventsPart`: observers, `#announce`, the event lock, held announcements |
|
|
755
754
|
| `engine/cards.rb` | `Engine::CardsPart`: `#show_card`, anytime commands |
|
|
756
|
-
| `engine/objectives.rb` | `Engine::ObjectivesPart`: the objectives stage's builder and forwards (`announce_objectives`, `show_objective_proposals`) |
|
|
755
|
+
| `engine/objectives.rb` | `Engine::ObjectivesPart`: the objectives stage's builder and forwards (`announce_objectives`, `show_objective_proposals`, `track_objectives_after`), Check this's and the tracker's side requests (`ask_objective_check`, `ask_objective_track`) |
|
|
757
756
|
| `engine/messages.rb` | `Engine::MessagesPart`: out-of-turn message edits, checkpoints, the live conversation |
|
|
758
757
|
| `engine/plugins.rb` | `Engine::PluginsPart`: plugins, init tasks, staged tools, `Plugin::Host` |
|
|
759
758
|
| `engine/hooks.rb` | `Engine::HooksPart`: turn-scoped hooks, the hook runtime, reminders |
|
|
@@ -87,7 +87,7 @@ runs mid-turn too). So does `chi send -m "/objectives …"`. A participant's com
|
|
|
87
87
|
## Moves
|
|
88
88
|
|
|
89
89
|
The `objectives` tool (`Tools::ObjectivesTool`, schema last in `TOOL_SCHEMAS`) has one action, `move`: `id`, `note`,
|
|
90
|
-
optional `evidence`. A call with no `action` is a move too. It is information only: nothing is written, and the call in
|
|
90
|
+
optional `evidence` and `state`. A call with no `action` is a move too. It is information only: nothing is written, and the call in
|
|
91
91
|
history is the record. A handler can't append an entry mid-turn safely, and a system entry would split a call from its
|
|
92
92
|
response, so there is no new entry kind. `Objectives.moves_in` reads the calls back with
|
|
93
93
|
`LLMContextStale.paired_runs`, as `WorkingSet` does: both hosts' forms, a `call_tool` of it as it ran. A run whose output
|
|
@@ -98,6 +98,32 @@ Mid-turn, `session.messages` doesn't hold the running turn. `/objectives` adds t
|
|
|
98
98
|
(`Engine#live_conversation`, a `dup` read on the command's thread), because `Engine#plugin_messages`' running part (the
|
|
99
99
|
Bridge's `TurnAccumulator#current_messages`) leaves tool calls out. A move shows once its result is in.
|
|
100
100
|
|
|
101
|
+
- **State** (`ObjectivesTool::STATES`): where the objective stands in the agent's view, `progress` (the default),
|
|
102
|
+
`blocked` or `done`, stripped and downcased (`state_of`); another word is refused with an `Error:` naming the three,
|
|
103
|
+
nothing recorded. `done` is a claim, never a status change. `Move#state` is `progress` for a saved call with none or
|
|
104
|
+
an unreadable one, so an older session's moves read as before. `Move#line` (the `/objectives` listing) leads with
|
|
105
|
+
`claims done: ` or `blocked: `; the view's `move` carries `state`; Check this's request says "The agent claims this
|
|
106
|
+
objective is done" for a done move. `ObjectivesCheck.mark_of` leaves the state out: `Move#ref` already makes a new
|
|
107
|
+
call a new move, and a state in it would drop every saved verdict at the upgrade.
|
|
108
|
+
- **Backing** (`Objectives::Backing`, `objectives_backing.rb`): what the move's own turn ran before it, derived by the
|
|
109
|
+
harness, since the model sees run ids only with the forget layer on and can't cite a run in general; its `evidence`
|
|
110
|
+
stays free text. `moves_in` builds it from the same `paired_runs`: the runs after the nearest turn opening before the
|
|
111
|
+
move's entry (`Steer.turn_prompt?`, what bounds a turn's slice), up to the move, those before it in its own batch
|
|
112
|
+
too. `edits` counts the edit and write runs that succeeded (not a failed, denied or interrupted one); `command` is the
|
|
113
|
+
last finished `execute` or `task_wait` run's `ok` or `failed`, read on the text after `ToolActivity.saved_result_text`
|
|
114
|
+
(with `tool_activity_status`, so a grep that found nothing is `ok`). No command: one the guardrails denied, stopped or
|
|
115
|
+
interrupted, an execute handed over as a task (it still runs), a `task_wait` whose task hadn't finished (a timeout, a
|
|
116
|
+
waiting message: its header's `status:` isn't `completed` or `failed`) or that waited on nothing.
|
|
117
|
+
`edited_after_command`: an edit or write succeeded after the last command that ran after the turn's first successful
|
|
118
|
+
edit (a command before any edit, `rg foo` → edit → done, checked none of the turn's edits, so an edit after it isn't
|
|
119
|
+
stale). The one flag, `unbacked`, is only for a `done` move after a command ran: the last command failed, or an edit
|
|
120
|
+
came after the last command that checked one (edit → rspec → edit → done). A `progress` or `blocked` move never flags,
|
|
121
|
+
and neither does a turn with edits and no command (a docs change would flag every time) or one with neither: those
|
|
122
|
+
are Check this's business. A result `paired_runs` can't pair is left out without a word, so there is no "unknown"
|
|
123
|
+
value. A rollback that drops the turn drops its runs with its move. The forget layer changes what is sent, not the
|
|
124
|
+
stored entries, so a forgotten run's status still reads. The view's `move` carries `backing` (`edits`, `command`,
|
|
125
|
+
`edited_after_command`, `unbacked`); `/objectives` says `not backed: edited after the last command ran` or `not backed:
|
|
126
|
+
the last command failed` under a flagged move, and nothing for any other.
|
|
101
127
|
- **The answer** says it recorded a move, that the list is unchanged and that the user edits it with `/objectives`; so
|
|
102
128
|
does the schema's description. Other actions get an `Error:` with the same sentence. A small model told to edit the
|
|
103
129
|
list has nothing to call, and this is the only place it is told so: no stable-prompt line.
|
|
@@ -110,8 +136,11 @@ Bridge's `TurnAccumulator#current_messages`) leaves tool calls out. A move shows
|
|
|
110
136
|
- **Guardrails**: no rule names it, so it passes with no ask, in `strict` too. `ReviewBoundary` denies it as anything
|
|
111
137
|
outside its kit. `PairBoundary` denies it as owner-voiced: a move stays in the owner's history and reads as the
|
|
112
138
|
session's own.
|
|
113
|
-
- **The row**: `recording a move` in the TUI's line with `id=`, `
|
|
114
|
-
|
|
139
|
+
- **The row**: `recording a move` in the TUI's line with `id=`, `state=` (blocked or done only, before `note=` so a cut
|
|
140
|
+
can't drop it: `ToolActivity#objectives_state_param`), `note=`, `evidence=`; the web's row is `objectives O2 note · evidence`
|
|
141
|
+
(`ToolActivity#tool_title`, unchanged, so an open page of the previous release still reads it). The page reads the
|
|
142
|
+
state from the row's params (`objectives_state.js stateOfParams`): a reload's row carries its saved params line
|
|
143
|
+
(`MessageParts#tool_part`). No UI of its own.
|
|
115
144
|
|
|
116
145
|
`serves` on `ask_user_question` waits until moves read well. The model can't edit the list.
|
|
117
146
|
|
|
@@ -164,7 +193,39 @@ command), which absorbs the file. It no longer waits for the fallback tick.
|
|
|
164
193
|
- **Moves** (`objectives_moves.js`): a tool row's id is a chip (`moveRowText`), and a row that recorded a move carries
|
|
165
194
|
`data-move-id`. One observer on `#history` reads those back into a line after each finished `.turn-work`, so a reload,
|
|
166
195
|
a live end and a hand-off all draw it. The newest line's Not yet is `objectivesStrip.notYet`. A decision card's
|
|
167
|
-
`Concerns O2` gets the chip there too.
|
|
196
|
+
`Concerns O2` gets the chip there too. A blocked or done move's row also carries `data-move-state`, drawn as
|
|
197
|
+
"blocked" / "claims done" beside the id, a word with a class, never colour alone; the words are
|
|
198
|
+
`objectives_state.js`'s, a module of its own so that no existing module imports a new export of another. The list's
|
|
199
|
+
`last move:` says the same words. A flagged backing is a muted `not backed: …` under the list's move and on that
|
|
200
|
+
objective's last move in the history (the view's move is the latest one), drawn only while no turn runs and none is
|
|
201
|
+
held in the stage (`objectives_wiring.js`, through `strip.moveOf?.()`, so a cached older strip draws nothing). An
|
|
202
|
+
unflagged move adds nothing on screen.
|
|
203
|
+
- **No move recorded**: the same observer marks the history's **newest** `.turn-work` only (an older turn's list of its
|
|
204
|
+
time isn't known) with a muted `no move recorded` line where its moves line would be, when the block holds no
|
|
205
|
+
`[data-move-id]`, holds at least one `edit`, `write` or `execute` row that went through (its status mark `ok`: not a
|
|
206
|
+
failed, denied or stopped one; an `objectives` call, a proposal too, is no work), ended `completed`, isn't a
|
|
207
|
+
participant's, comes after the list's first note in the history (`.objectives-entry`: a turn that ran before there
|
|
208
|
+
was a list had nothing to move on), no newer turn's prompt follows it (`bubbles.js TURN_PROMPT`: a plain turn has no
|
|
209
|
+
block), and the strip's list has an active item (`objectives_state.js hasActive`, through `strip.hasActive?.()`).
|
|
210
|
+
Otherwise the line goes: a move in that turn, a newer turn, a list with nothing active. Gated on no turn running and
|
|
211
|
+
none held in the stage (as Short version is): while a finished turn is held, the history's newest block is the turn
|
|
212
|
+
before it. `turn_block.js` stamps what it reads, live and in a reload's drawing alike: the block's `data-end`
|
|
213
|
+
(completed, canceled, failed, in `turnEnded`), `data-participant` for a participant's turn (from `turn_started`'s
|
|
214
|
+
author live, the prompt's author in `drawnGroupPieces`), and each row's `data-tool` (also `turn_html.js
|
|
215
|
+
toolRowTemplate`, so live and reloaded rows stay the same markup). A pair turn's `objectives` call is always denied,
|
|
216
|
+
so without the participant stamp every pair turn that edits would get it. The participant page draws none of this.
|
|
217
|
+
- **The tracker** (`objectives_track.js`, a module of its own for the same reason): the list's row under an item it read
|
|
218
|
+
says `tracker: no sign — nothing ran for it · 14:32` (`.obj-track`), with weight and the warn colour when it differs
|
|
219
|
+
from the agent's last move's state (`trackDiffers`: a move to compare with, a reading other than no answer), faded when
|
|
220
|
+
stale, the model in its tooltip. **Where are we?** posts `/objectives track` as a strip tap does (`card: true`, no
|
|
221
|
+
echo; the card is the answer): at the list's foot while an objective is active (off and `Reading where they stand…`
|
|
222
|
+
while the view has `tracking`, which lets go at its `until` as a check does), and on the `no move recorded` line
|
|
223
|
+
(`objectives_moves.js`, `data-offer` redraws it when the gate flips). Both only where the worker names the
|
|
224
|
+
`objectives_track` Bridge feature (the `objectivesTrack` gate in `app.js`'s `createFeatureGates`, `trackWorkerUnavailable`
|
|
225
|
+
on `workerPredates`; `canTrack` through the wiring, so a cached older strip or moves module ignores it). The strip's
|
|
226
|
+
`listSig` leaves out `track` (and `tracking` is the view's, not an item's), so a read's start and end don't clear Not
|
|
227
|
+
yet's state. An open page of the previous release against a new worker ignores `track` and `tracking`; its `listSig`
|
|
228
|
+
does count `track`, so there a read's end lets Not yet be sent again.
|
|
168
229
|
- **Not yet** is `POST /turn` with a client id of its own (`<tab>:objectives`), so the stream draws its bubble in every
|
|
169
230
|
tab, this one too: the page's own echo needs the composer. It steers a running turn or starts a turn, as a typed line.
|
|
170
231
|
- **Short version**: the same observer offers `/short` (decision-card) under the newest long answer (`foldable`), only with a list
|
|
@@ -229,8 +290,8 @@ the record settles is `unclear`, and a file changed since isn't seen. If that tu
|
|
|
229
290
|
next step, and the file and view below can stay.
|
|
230
291
|
|
|
231
292
|
**Independence.** The request (`ObjectivesCheck.request`) has its own system text and no tools. Its record is what people and
|
|
232
|
-
notes said, what tools returned, and the agent's visible answers labelled `[agent's own words]` (
|
|
233
|
-
newest 24,000 kept). Without those answers a claim about what the agent said or asked could only come back `unclear`. So the request says they settle
|
|
293
|
+
notes said, what tools returned, and the agent's visible answers labelled `[agent's own words]` (`ObjectivesRecord.record`, each entry cut at 1,500 characters, the
|
|
294
|
+
newest 24,000 kept; the record, its frame and the redaction are `objectives_record.rb`'s, which the tracker reads too). Without those answers a claim about what the agent said or asked could only come back `unclear`. So the request says they settle
|
|
234
295
|
what was said or asked and are never proof of work, which needs a tool's output or a person's word. That rule is words to a model, not a mechanism: a
|
|
235
296
|
probe on Qwen3.8 Flash Next held it 3 of 3 (only the agent's "all pass": `unclear`), and a verdict is information only either way.
|
|
236
297
|
The record never holds the agent's thinking (`AnswerText.visible`, the rule the continue note's last answer and decision-card's `/short` share: a chat entry's `thinking` and `anthropic_content` aren't read; a native
|
|
@@ -247,7 +308,7 @@ the frame to hold; a model may still be swayed by text inside it, which is why a
|
|
|
247
308
|
`Samagotchi::Redact.text`, chi's participant redaction: known key shapes and `token=`-style values become `[redacted]`, and
|
|
248
309
|
the home folder `~`. That is by pattern, so a secret of another shape still goes.
|
|
249
310
|
|
|
250
|
-
**State.** `objective_checks.jsonl` beside the session: a `running` line, then one with `verdict` (confirmed, refuted, unclear,
|
|
311
|
+
**State.** `objective_checks.jsonl` beside the session (its lines written and read by `JsonlStore`, `jsonl_store.rb`): a `running` line, then one with `verdict` (confirmed, refuted, unclear,
|
|
251
312
|
`no_answer`), `reason`, `text`, `model` and `mark`: a digest of the item's line as sent and the move itself (`Move#ref`, its run's
|
|
252
313
|
id and its model entry's time, with its words). The start is under `Objectives.with_lock`, so a double tap or a second tab answers "already
|
|
253
314
|
being checked" and asks nothing. A running line stops counting once its worker's pid is gone, so a kill, a shutdown or a restart frees
|
|
@@ -263,6 +324,74 @@ writes no `pending_card.json`, so no push), the list's row, and `check:` under t
|
|
|
263
324
|
command route is the owner's, and `card` and `objectives_updated` are in `ParticipantView::DROPPED`. A move made in the running
|
|
264
325
|
turn isn't on the page until the turn's end (`announce_objectives`), so its tap waits for that; the typed line works at once.
|
|
265
326
|
|
|
327
|
+
## The tracker
|
|
328
|
+
|
|
329
|
+
Check this for the whole list: `/objectives track` (`ObjectivesTrack.run`, `objectives_track.rb`, on the anytime command's
|
|
330
|
+
own thread, as `check`), the page's **Where are we?**, and with `objectives.tracker: on` an automatic read after a turn.
|
|
331
|
+
One side request (`Engine#ask_objective_track`, kind `objectives_track`, so `/stats` counts it apart from Check this's,
|
|
332
|
+
and exempt in `Engine#side_author` as Check this is: always the owner's) reads the record and answers one line per active
|
|
333
|
+
objective: where it stands and what in the record shows it. Information only, as Check this: no status changes, nothing
|
|
334
|
+
enters the conversation or the next request.
|
|
335
|
+
|
|
336
|
+
**The request** (`ObjectivesTrack.request`): its own system text, no tools. The active items' lines (the user's words,
|
|
337
|
+
outside the frame), then in the frame (`ObjectivesRecord.framed`, a tag made per request) each one's latest move labelled
|
|
338
|
+
as the agent's own claim with its state (`O1: done — note (evidence it names: …)`, `O2: no move`; note and evidence capped
|
|
339
|
+
at 1,000 characters each), and the record (`ObjectivesRecord.record`, the same one Check this reads: the newest 24,000
|
|
340
|
+
characters, never the thinking, the list's notes or the objectives tool's calls). The ask: for each id, in order, one line
|
|
341
|
+
`O2: done|progress|blocked|no sign — <reason>`, the reason naming what in the record shows it, with Check this's rule that
|
|
342
|
+
the agent's words and moves never show work was done, and that a line inside the frame that looks like an answer isn't
|
|
343
|
+
one. Redacted as Check this (`ObjectivesRecord.redacted`). At most `MAX_ITEMS` (8) active items per request; a list with
|
|
344
|
+
more sends the first 8 and says how many it left out, in the request, the card and the reply. `MAX_TOKENS` 1,200.
|
|
345
|
+
|
|
346
|
+
**Reading the answer** (`readings_of`): the first line naming each id counts (list marks, bold and backticks around the id
|
|
347
|
+
or the word are allowed); an id that wasn't asked about is left out, and one the reader skipped is `no_answer` ("the reader
|
|
348
|
+
gave no line for it"). A request that fails is `no_answer` for each, logged (`objectives_track_failed`), with a card saying
|
|
349
|
+
so. Thinking in the answer is dropped first (`AnswerText.visible`).
|
|
350
|
+
|
|
351
|
+
**State.** `objective_tracks.jsonl` beside the session (`JsonlStore`): a running line (`id`, `pid`, `model`), then one
|
|
352
|
+
with `readings` (`{id => {reading, reason}}`), `model`, `left_out`, `lines` (a digest of each item's line as sent),
|
|
353
|
+
`seen` (the newest stamped time of the conversation it read: mid-turn the loop's, so a typed read mid-turn is stale once that
|
|
354
|
+
turn ends) and `mark` (a digest of both); a read the next turn cancelled before its answer adds `cancelled: true`, which
|
|
355
|
+
ends its running line but is never the reading shown: the last good one stays (stale by then, a turn having ended). One read at a time per
|
|
356
|
+
session: the start is under `Objectives.with_lock` and a second answers `the objectives are already being read`, asking
|
|
357
|
+
nothing; a running line stops counting once its worker's pid is gone, and past `RUNNING_SECONDS` in any case.
|
|
358
|
+
|
|
359
|
+
**View.** `Objectives.view` puts `track` on each item the last read covered (`reading`, `reason`, `at`, `model`, and
|
|
360
|
+
`stale: true` once the item's line differs from the one sent or the stored conversation's newest time differs from
|
|
361
|
+
`seen`: a turn ended, a note came in), and `tracking: {until}` on the view while one runs (no key otherwise, so a view
|
|
362
|
+
without a read is the one before). `announce_objectives` carries the start and the end. `/objectives` shows `track: …`
|
|
363
|
+
under each item (after its move and check), `(stale)` at its end, and `objectives: (tracker: running)` while one runs.
|
|
364
|
+
|
|
365
|
+
**The card**: one, with no actions (`source: objectives`, `objectives-track-<id>`, so no `pending_card.json` and no
|
|
366
|
+
push), for the typed command and an automatic run alike. Its text is plain, one paragraph per line and no markdown marks:
|
|
367
|
+
a live card shows its body as text (it carries no `body_html` until a re-read), a reloaded one rendered, and both read the
|
|
368
|
+
same.
|
|
369
|
+
|
|
370
|
+
**The automatic run.** `Engine#complete_turn` calls `TurnStages::Objectives#track` beside `outgoing` (a completed turn,
|
|
371
|
+
not a canceled or exhausted one), on the turn's thread after `end_turn` and before `release_turn`.
|
|
372
|
+
`ObjectivesTrack.after_turn?` decides, in this order: the setting (`objectives.tracker`, default `off`), then the list (an
|
|
373
|
+
active item; `pending_payload` is a file read), then the turn: not a `--non-interactive` run (`Engine#interface ==
|
|
374
|
+
:non_interactive`: its origin can't tell, `ClientId.human?(nil)` is true), the owner's (`OwnerPrompt.turn?`: not a
|
|
375
|
+
participant's, not a review session's; a person's prompt or a wake), and the newest turn of the stored conversation (after
|
|
376
|
+
its last `Steer.turn_prompt?` entry) has at least one run that is work (`Objectives::Backing.work?`: an edit or write that
|
|
377
|
+
succeeded, an execute that finished ok, the page's no-move rule) and no objectives call that recorded a move. The stored
|
|
378
|
+
conversation is copied on the turn's thread; the request goes on a thread of its own kind (`SideJudgments#start`), so the
|
|
379
|
+
turn's end never waits, and a turn while one is still in flight starts none.
|
|
380
|
+
|
|
381
|
+
**Cancel.** The stage keeps the automatic read's `CancellationController` (set only once its thread started) and
|
|
382
|
+
`cancel_track` cancels it (`:new_turn`) first thing in `Engine#begin_turn`, before the turn's own probes and waits, for
|
|
383
|
+
every turn, a wake's too, so a one-slot server is free for it. A read cancelled before it asks asks nothing; a request
|
|
384
|
+
cancelled mid-way raises `LLM::RequestCancelled`. Either way the read writes its `no_answer` line stamped `cancelled` and
|
|
385
|
+
shows no card. The typed command is never cancelled. The automatic read's card waits for the turn it follows to end
|
|
386
|
+
(`turn_running?`) and is shown in `running_anytime`; once a next turn has started (it cancels), an answer that came in
|
|
387
|
+
time still goes to the list, with no card in the middle of that turn. A qualifying turn while the previous read's thread
|
|
388
|
+
still runs starts none (logged at debug, `objectives_track_skipped`).
|
|
389
|
+
|
|
390
|
+
**Limits.** It reads the record only (the newest 24,000 characters): it can't open a file or run anything. With
|
|
391
|
+
`objectives.tracker: on` and a hosted `objectives.check_model`, that record leaves the machine after such a turn without a
|
|
392
|
+
tap. It is refused during a participant's turn (`Engine#turn_author`), and a participant can't reach it (the command route
|
|
393
|
+
is the owner's; `card` and `objectives_updated` are in `ParticipantView::DROPPED`).
|
|
394
|
+
|
|
266
395
|
## System 1 in audit
|
|
267
396
|
|
|
268
397
|
`ObjectivesAudit`, off unless `objectives.system_one: audit`. `TurnStages::Objectives` asks it: `incoming` at an owner's
|
|
@@ -271,10 +400,13 @@ between turns (docs/internals/engine.md, "Turn stages"). See [system-one.md](../
|
|
|
271
400
|
|
|
272
401
|
## Not in this version
|
|
273
402
|
|
|
274
|
-
Stable-prompt lines aren't here, and terminals have no picture: they keep `/objectives`.
|
|
403
|
+
Stable-prompt lines aren't here, and terminals have no picture: they keep `/objectives`. Nothing asks the model to
|
|
404
|
+
record a move: a missing one only shows (`no move recorded`). The tracker reads the record, never the files: a claim the
|
|
405
|
+
record doesn't settle is `no sign` or `progress`, not a check of the work.
|
|
275
406
|
|
|
276
407
|
Taking it out: old notes stay readable framed bubbles and keep being sent, and the key is ignored. Old `objectives` calls
|
|
277
408
|
stay as history; with a kit no longer declaring the tool, they are ordinary saved calls. The card's bundle uninstalls. The
|
|
278
409
|
page's pieces are the `objectives_*.js` modules and `objectives.css`, wired in a few lines of `app.js`; without them a list note
|
|
279
410
|
falls back to the default bubble once `noteBubbleTemplate`'s first line goes. Check this is `objectives_check.rb`, its line in the command and
|
|
280
|
-
the `check` key; the
|
|
411
|
+
the `check` key; the tracker is `objectives_track.rb`, its line in the command, the stage's `track` and `cancel_track`, the
|
|
412
|
+
setting and the `track` and `tracking` keys; the audit is `objectives_audit.rb` and three calls in `TurnStages::Objectives`. Old `objective_checks.jsonl` files and saved runs are then read by nothing.
|
|
@@ -106,12 +106,11 @@ registry flag (`--recap-base-url` …) is this machine's config: `LOCAL_ONLY` wi
|
|
|
106
106
|
`timeout: min(time left, WAIT_SLICE)` (30 s). The server runs `ReplyWait.call` for at most `WAIT_MAX_SECONDS` (30 s)
|
|
107
107
|
and returns the `ReplyWait::Result` fields plus `parent_strategy`. On a `timeout` status the client asks again until
|
|
108
108
|
its own `--timeout` runs out, at which point it builds the `timeout` result itself. Each slice is a fresh `ReplyWait`
|
|
109
|
-
there,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
two releases on (the wire keeps accepting it and ignores it then). A 503 `server_stopping` (chi web
|
|
109
|
+
there, and nothing is carried from one to the next: the worker names every turn (a wake turn's `wake-…` id) and
|
|
110
|
+
records a steer's merge (`input/merged/`), so a wait binds the turn's id and a dead worker's turn settled between
|
|
111
|
+
two slices ends it `canceled` (`worker_stopped`) by that id, as locally. (Until 0.166 a `timeout` answer carried
|
|
112
|
+
the slice's `running_look`, for a 0.156 worker's id-less turns; chi web now ignores one a 0.165 client still sends.)
|
|
113
|
+
A 503 `server_stopping` (chi web
|
|
115
114
|
shutting down mid-wait: `ReplyWait`'s `cancelled:` returns `:canceled`) is retried after `RETRY_AFTER` (1 s).
|
|
116
115
|
`HTTPTransport::READ_TIMEOUT` (75 s) is set above the longest answer, a wait slice or a create's wait for its worker.
|
|
117
116
|
6. **The report.** `ParentReport.report` prints it as it does locally. It uses `Remote#parent_strategy`, which
|