ace-wake 0.5.0 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79e28ea5377567228c8d0febc0ca9a248bb355cc0ac52c4338c194ffd3022361
4
- data.tar.gz: '04477178857419a92d25a1735c3bd43c159cabc6883330e5109e44a2aeae2339'
3
+ metadata.gz: 9afcbbad6572671d6cec0e13903d780730eb674defbe09edfaa7a0e7315c45f1
4
+ data.tar.gz: 8666dd3458139e795f165dd3a7400e1824cf3b2177f6ffdab42e668f2797dff3
5
5
  SHA512:
6
- metadata.gz: f878d66ed9811def6bd10e531e34722e3f9bbeb2e757edb208c2b28c606266912ad88691d981b8ccb995e901afa9c3262aba97e662c0b463e75a26de488e775d
7
- data.tar.gz: c1151b4fc90cccfeb1d60d12b93ef998670fe1924c23263a8abd0cccc12e70d8bb1c8e2c5aebbb09bff7e6ef570c07aa00ef5acb9996f0f88bcc5dfcacf393fc
6
+ metadata.gz: 4357918fc088ab7d4d23f128a5d7fcfcdc64ef24b69f87fe10c8bbf3606546281894b99b49321b15f1e86fec92c2e3d61d16084fb67516635c4dd1e65a312a18
7
+ data.tar.gz: b561dd16c0b6e98bdf21eb6101d22e22875449a8025ab7cd6dded2a36f503b32673c6fa69753a9d30fc9a1d480ab23246d58e4a12f0db6ce68858cce8793dfe1
data/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.0] - 2026-11-17
9
+
10
+ ### Added
11
+
12
+ - `ace-watch` CLI for standalone Eyes, watches, loops, exact ACK, report processing, foreground observation and explicit delivery/recovery operations. No Pi session, provider credentials or model inference is needed.
13
+ - Private transactional actor state, kernel-backed runner exclusion, per-target delivery/presentation and persisted watch baselines. Concurrent commands preserve newer revisions; foreground and attached processes stop cleanly.
14
+
15
+ ### Changed
16
+
17
+ - Pi is an optional adapter to the installed CLI. Core modules ship once in the gem runtime; projected extensions contain only the adapter. Existing session snapshots import once into an empty actor, preserving pending work and ACKs.
18
+ - Model-visible Eyes output and presentation tracking share a UTF-8 byte limit; model metadata contains scalar counts instead of pending maps. Watch deltas describe changes without internal fingerprints.
19
+ - Require ace-overseer >= 0.31.5 for CLI source operations and canonical-state readiness. The gem name remains ace-wake.
20
+
8
21
  ## [0.5.0] - 2026-11-16
9
22
 
10
23
  ### Changed
data/README.md CHANGED
@@ -1,146 +1,126 @@
1
- # ace-wake
2
-
3
- Pi agent extension: `/loop` timers and `/watch` file subscriptions that wake
4
- idle agents with bounded, coalesced wake messages through `sendUserMessage`
5
- only. Definitions survive reload/restart with exactly-once re-registration;
6
- there is no cron, daemon, heartbeat, or delivery-queue engine.
7
-
8
- ## Provenance
9
-
10
- This directory is the canonical source of the ace-wake extension. It was
11
- developed and tested inside `ace-handbook-integration-pi/handbook/extensions/ace-wake/`
12
- and moved here (verbatim, with its JavaScript test suite) as its top-level
13
- home. The deployed copy at `~/.pi/agent/extensions/ace-wake` is root-owned,
14
- dated 2026-10-16, and is a STALE generation of this source (no eyes, no
15
- worktree inbox discovery, no watch deltas); it was intentionally left
16
- untouched.
17
-
18
- This package is a publishable gem (task 8xs.t.pu0.0). The extension source
19
- lives at `handbook/extensions/ace-wake/` (single copy) and ships in the
20
- `ace-wake` gem; deployment is converged, not manual:
21
-
22
- - `ace-handbook sync --provider pi` projects it into a project's
23
- `.pi/extensions` (the pi provider manifest declares
24
- `extensions_package: ace-wake`);
25
- - the `ace-lab` installer projects it from the EXACT installed gem version
26
- into each manifest-declared extension directory (`gemset.extensions`),
27
- reporting the loaded version and any restart need.
28
-
29
- ## Standing observation
30
-
31
- `/eyes` keeps observing source revisions while an agent is working. It does
32
- not enqueue a follow-up during that turn: the agent can acknowledge a revision
33
- it handles itself. Once the agent is idle and its other pending messages have
34
- cleared, the next observation delivers any still-unhandled revisions. This can
35
- delay notification by one observation interval, but avoids turns for changes
36
- already handled during the active turn.
37
-
38
- The effective observation interval is the larger of `intervalSeconds` and
39
- `3600 / maxObservationsPerHour` seconds, rounded up to a whole timer interval.
40
- Local deadlines are checked on timer ticks even when source reads are throttled.
41
- Extra observations can consume the remaining hourly allowance; the timer stays
42
- armed and observation resumes automatically in the next window, including
43
- after restart. The hourly wake allowance limits delivery while observation
44
- continues to coalesce pending revisions. Delivery resumes with the next
45
- window. Provider quota and failure breakers still require explicit recovery.
46
-
47
- ### Bounded digests, not pending-map dumps
48
-
49
- Every model-visible eyes surface renders bounded readable text; internal
50
- 64-hex event keys, revisions and receipt timings never reach the model.
51
-
52
- - Unchanged observations wake nobody. A healthy idle `ace_eyes action status`
53
- answers with one line (`eyes observing · no changes pending · …`).
54
- - A wake carries the semantic delta only: one line per change with a readable
55
- note and the next action (`report 8xhq2e success (task 148) — run ace_eyes
56
- action process-reports …`), an omitted count when the batch or backlog is
57
- larger, and fixed guidance. Single changes stay within 1–3 lines; the text
58
- is hard-bounded at 10 lines / 2048 characters.
59
- - `ace_eyes action status` (and `/eyes status [FILTER]`) shows a compact
60
- overview: state, pending count, wake budget, source health, then the
61
- decision-needed events first. Large backlogs group behind an omitted count
62
- with a `filter` hint (kind or id substring). Degraded sources are always
63
- named with their error head — failures are never silently hidden.
64
- - `ace_eyes action process-reports` returns only its outcome digest: counts,
65
- per-event outcome lines with bounded messages, and how many completed
66
- report revisions were acknowledged internally. Operational failures stay
67
- tool errors, never quiet success.
68
- - Acknowledgement resolves short ids inside the tool: `ace_eyes action ack`
69
- with `id` (also `/eyes ack ID`) matches exactly one pending event —
70
- `deadline:<name>` for deadlines, `kind:id` when a bare id is ambiguous —
71
- and refuses unknown or ambiguous targets without side effects. Model-facing
72
- acks are held to the revision the model was actually shown (wake or
73
- `ace_eyes status`): a stale id acknowledges its presented revision and
74
- keeps any newer unseen revision pending to re-report. The operator
75
- `/eyes ack` command acts under explicit human authority on the revision the
76
- operator just viewed. Exact revision matching remains internal; display
77
- never acknowledges.
78
-
79
- ## Mount-aware poll fallback
80
-
81
- `/lab/state/hitl-address/ace` (the HITL transport folder) is a FUSE/virtiofs
82
- mount where inotify event delivery is unreliable: a registered `/watch` never
83
- fires there. The watch port (`wake/watch-subscription.js`) classifies every
84
- watched target through a `statfsFn` port (`node:fs.statfsSync` by default;
85
- string fstype or Linux `f_type` magic number) and, for targets on unreliable
86
- mounts (virtiofs, fuse, fuseblk, fusectl), runs a 2.5 s reconcile timer that
87
- re-stats the aggregate fingerprint and wakes on change. `fs.watch` stays
88
- primary everywhere else; a failing or unsupported statfs keeps `fs.watch`
89
- primary rather than failing the watch.
90
-
91
- ## Ask bridge (the `ace-hitl ask` contract)
92
-
93
- `ace-hitl ask` is create + send + arm + END TURN: it never blocks and never
94
- polls. The asking agent's Ruby process drops one wake-request file into
95
- `<session cwd>/.ace-local/hitl/wake-requests/<case id>.json`:
96
-
97
- ```json
98
- {"schema": "ace.wake.ask/v1", "kind": "ask", "case_id": "8xhkep",
99
- "case_path": "/abs/worktree/.ace-local/hitl/8xhkep-slug/8xhkep-slug.hitl.s.md"}
1
+ # ace-wake / ace-watch
2
+
3
+ The ace-wake gem installs **ace-watch**, a standalone CLI for economical Eyes,
4
+ file watches and loop timers. Humans, Codex and other agents use the same
5
+ commands. Pi is an optional adapter; no model or model credentials are needed
6
+ for observation, status, ACK or report-owner reconciliation.
7
+
8
+ The CLI needs Ruby >= 3.2, Node.js with structuredClone support, and the gem's
9
+ runtime dependencies. Eyes delegates canonical observation/report effects to
10
+ ace-overseer; configured native sync routes also need ace-hitl-hermes. Missing
11
+ owners fail explicitly. No command starts a model, daemon or external service.
12
+
13
+ ## Observe once, inspect, acknowledge
14
+
15
+ Run from the intended project/worktree. Actor defaults to self; integrations
16
+ supply a stable name. There is no newest-session discovery or cwd fallback.
17
+
18
+ ```sh
19
+ ace-watch --help
20
+ ace-watch --version
21
+ ace-watch --actor self eyes start --config eyes.json
22
+ ace-watch --actor self eyes observe
23
+ ace-watch --actor self eyes status
24
+ ace-watch --actor self eyes status --json
25
+ ace-watch --actor self eyes ack EVENT_ID --revision EXACT_TOKEN_FROM_JSON_STATUS
26
+ ace-watch --actor self eyes process-reports
100
27
  ```
101
28
 
102
- The extension consumes that folder WITHOUT any agent turn activity
103
- (`wake/ask-bridge.js`, wired in `index.js` as `startAskBridge`): a small
104
- internal watch port anchors on the folder — or, while it does not exist yet
105
- (the first `ask` creates it), on its nearest existing ancestor and promotes
106
- itself once it appears — and its reconcile passes arm one scoped registry
107
- watch named `ask-<case id>` on the case file, then consume the request.
108
- When the answer lands (the Captain's reply flows through the transport into
109
- the case file), the case file's fingerprint changes and the wake fires with
110
- the `## Answer` section as its excerpt, so the wake carries the answer
111
- content; the agent acts immediately on wake. Arming is idempotent (an
112
- already-armed case consumes a stale request without re-arming, which would
113
- reset the baseline and could swallow a landed answer), an unreadable case
114
- file leaves the request pending, and the armed watch persists through
115
- reload/restart like any registry watch — nothing expires on the asker side.
116
- On unreliable mounts the armed watch fires only through the poll fallback
117
- above; that fallback is what makes ask work end to end there.
118
-
119
- ## Tests
29
+ Configuration uses the existing Eyes keys: intervalSeconds, maxEvents,
30
+ maxObservationsPerHour, maxWakesPerHour, timeoutMs, maxErrors, maxPending, scope,
31
+ recipient and syncRoutes. Existing overseer configuration remains at
32
+ .ace-local/overseer/eyes.json under ace-overseer ownership.
33
+
34
+ Start validates configuration and observes once without enqueuing a redundant
35
+ notification. A subsequent observation prints only its new semantic delta;
36
+ repeating unchanged state prints no event text and invokes no model. Explicit
37
+ status is a compact view (at most ten lines/2048 UTF-8 bytes), with omitted
38
+ counts and a kind/id filter. JSON is an explicit diagnostic receipt including
39
+ exact revisions and the backlog; automatic foreground output emits only events.
40
+
41
+ Terminal ACK requires the selected revision. A racing newer revision is
42
+ preserved or refused. Report processing uses the existing business owner;
43
+ only exact accepted receipts with completed cleanup acknowledge reports.
44
+ Incomplete work stays pending for normal idempotent retry. Merely reading,
45
+ printing or delivering an event never accepts its business effect.
46
+
47
+ ## Watches, timers and foreground execution
48
+
49
+ ```sh
50
+ ace-watch watch add build --path build.log --message 'Inspect build change'
51
+ ace-watch loop add reminder --interval 60 --message 'Inspect outstanding work'
52
+ ace-watch watch list
53
+ ace-watch loop list
54
+ ace-watch run
55
+ ```
56
+
57
+ Definitions do not silently launch a process. run stays in the foreground;
58
+ Ctrl-C or TERM closes handles and releases runner exclusion. A second runner
59
+ for the same actor is refused. Remove a definition from another terminal to
60
+ stop its live handle. A persisted baseline covers the registration/attachment
61
+ gap and identical file bytes stay quiet. Missed loop ticks are not replayed.
62
+
63
+ Watch output names the changed path/kind and a bounded excerpt; internal
64
+ fingerprints stay in the owner state. Use --redact for secret watches. The
65
+ existing ask bridge recognizes secret wake requests and strips answer excerpts;
66
+ only the case reference is delivered. Existing mount-aware watch reconciliation
67
+ and linked-worktree discovery are reused. A failed watch is named in list/status
68
+ and emits one actionable failure; repair and remove/re-add it to rearm.
69
+
70
+ ## Recovery and delivery targets
120
71
 
121
72
  ```sh
122
- node --test test/*.test.mjs
73
+ ace-watch status --json
74
+ ace-watch eyes deadline review1 attempt2 ABSOLUTE_EPOCH_MILLISECONDS
75
+ ace-watch eyes cancel review1
76
+ ace-watch eyes resume --quota-verified
77
+ ace-watch eyes retire
123
78
  ```
124
79
 
125
- Run from this directory. The glob covers the deterministic unit/acceptance
126
- suites only; the env-gated real-runtime acceptance in `test/acceptance/` is
127
- excluded and skipped when its environment is missing.
128
-
129
- Two environment caveats:
130
-
131
- - `test/report-wake-worktree.test.mjs` spawns this clone's `bin/ace-hitl`,
132
- which needs the repository's bundler setup and `ACE_TOOLCHAIN=auto` (the
133
- repo dev default). An inherited `ACE_TOOLCHAIN=installed` shell makes
134
- those two tests fail.
135
- - `test/acceptance/pi-sdk-acceptance.test.mjs` runs the extension inside the
136
- REAL Pi SDK runtime. It needs `PI_PKG_ROOT` (the pi-coding-agent package
137
- directory) and `EXT_PATH` (the published entrypoint
138
- `handbook/extensions/ace-wake/index.js`), and is normally driven by the
139
- ace-handbook-integration-pi feat harness
140
- (`bin/ace-test ace-handbook-integration-pi feat`):
141
-
142
- ```sh
143
- PI_PKG_ROOT="$(npm root -g)/@earendil-works/pi-coding-agent" \
144
- EXT_PATH="$PWD/handbook/extensions/ace-wake/index.js" \
145
- node --test test/acceptance/pi-sdk-acceptance.test.mjs
146
- ```
80
+ Resume requires explicit owner verification of quota/readiness. It reconciles
81
+ unconfirmed notifications without discarding pending work or durable ACKs.
82
+ Inspect the existing effect owners before retrying any external action.
83
+
84
+ Every adapter lifecycle operation is also public: delivery ready/active/busy,
85
+ suspend, settle, confirm ID, reject ID, uncertain, quota and detach. Select a
86
+ receiver with --target NAME. ready allows Eyes and subscriptions; active permits
87
+ queued subscription follow-ups while Eyes waits for idle; busy/suspend retains
88
+ both. confirm proves transport consumption, not business acceptance. reject is
89
+ only for a known-unsent attempt; an unknown outcome must remain uncertain.
90
+ The selected target's outstanding receipt is visible in status --json.
91
+
92
+ Default terminal output confirms a successful write automatically. A consumer
93
+ using --defer-confirm must confirm its exact receipt itself. Terminal delivery
94
+ never suppresses an independent Pi target. Terminal/operator inspection cannot
95
+ authorize a model ACK of an unseen revision. --present records only the selected
96
+ target's actually rendered revisions; --command-string uses the same argument
97
+ grammar as the Pi slash-command adapter. See help for all operations.
98
+
99
+ ## State, Pi and installation
100
+
101
+ The sole wake owner writes .ace-local/wake/ACTOR/state.json under the selected
102
+ cwd. State is private, checkpointed atomically and updated under OS file locks.
103
+ It contains wake bookkeeping, not copied task/assignment/report state. Status
104
+ reads do not create actor files. Runner exclusion is separate from short
105
+ transactions, so concurrent CLI commands remain possible. See docs/lab-flow.md.
106
+
107
+ Pi keeps /loop, /watch, /eyes and ace_eyes. Its projected extension invokes the
108
+ installed CLI, translates lifecycle/delivery and retains a read-only actor
109
+ binding. Existing session snapshots import once only when actor state is empty;
110
+ historical entries remain history. Core algorithms live in libexec/ace-watch,
111
+ not in the projected adapter. ACE_WATCH_EXECUTABLE is an explicit executable
112
+ selector for controlled integrations/tests; there is no source-checkout fallback.
113
+
114
+ ace-handbook sync --provider pi and the existing ace-lab installer still
115
+ project the adapter from this gem. The host must install the new pinned gem
116
+ closure, expose ace-watch and project the matching adapter before restarting
117
+ selected sessions. A source test or a published gem alone is not installed proof.
118
+
119
+ ## Verification
120
+
121
+ Use ace-test ace-wake all. The Ruby CLI tests execute the actual executable
122
+ against controlled canonical-owner fixtures, concurrent commands, real file
123
+ changes and foreground timers. The JS suite retains domain/watch regression
124
+ coverage and checks the shared command core and optional adapter. The real Pi
125
+ SDK acceptance uses a scripted offline provider, explicitly configured through
126
+ the runner fixture environment. It is separate from live installed Lab evidence.
data/exe/ace-watch ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require_relative "../lib/ace/wake/cli"
5
+ exit Ace::Wake::CLI.new.call(ARGV)