ace-wake 0.4.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: 90d56b134bd020956dbdf73c1b52f3a6988bd2bce06dbf1b0bf8a52c9d5b089c
4
- data.tar.gz: 0a7357f6d16c6c05d19fb58c473225473dea6aeff312fb4d77f7a2a4b3fc73a6
3
+ metadata.gz: 9afcbbad6572671d6cec0e13903d780730eb674defbe09edfaa7a0e7315c45f1
4
+ data.tar.gz: 8666dd3458139e795f165dd3a7400e1824cf3b2177f6ffdab42e668f2797dff3
5
5
  SHA512:
6
- metadata.gz: 45d4bc561feefe1142559eb996b7c5338082eb52993cb180d4fab926003b1c73e8cce58f4d309732939d2e42186256c6c581f425e4f8cf185a8d56ed97bf8185
7
- data.tar.gz: e3ee0958695b688f938bd3c8e778edb8fd11fc992b4bdb747483b2f6c7d70f053f1ed1f09eda8edb23dbd3e0ed1ee09c9195547529b290b0257388e5f78e8fbd
6
+ metadata.gz: 4357918fc088ab7d4d23f128a5d7fcfcdc64ef24b69f87fe10c8bbf3606546281894b99b49321b15f1e86fec92c2e3d61d16084fb67516635c4dd1e65a312a18
7
+ data.tar.gz: b561dd16c0b6e98bdf21eb6101d22e22875449a8025ab7cd6dded2a36f503b32673c6fa69753a9d30fc9a1d480ab23246d58e4a12f0db6ce68858cce8793dfe1
data/CHANGELOG.md CHANGED
@@ -5,7 +5,33 @@ 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
- ## [Unreleased]
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
+
21
+ ## [0.5.0] - 2026-11-16
22
+
23
+ ### Changed
24
+
25
+ - Render every model-visible eyes surface as a bounded plain-text digest (task 8yf.t.imq): wakes carry the semantic delta with next actions instead of a JSON batch dump; `ace_eyes status`, `/eyes status` and tool metadata return a compact overview (≤10 lines / ~2 KB) with omitted counts and a `filter` escape hatch; `process-reports` returns an outcome digest only. Internal event keys, revisions and receipt timings no longer reach the model.
26
+ - Acknowledge events by short id inside the tool (`ace_eyes action ack` with `id`, `/eyes ack ID`): exact resolution to one pending event, `deadline:<name>` and `kind:id` forms, unknown/ambiguous ids refused without side effects. Exact revision matching stays internal; unchanged sessions render restored entries with a hash-free fallback note.
27
+
28
+ ### Fixed
29
+
30
+ - Repeated unchanged observations never repeat a delivered delta, and a degraded source is always named with its error head in status instead of hiding behind a healthy summary.
31
+ - `/eyes status [FILTER]` renders the digest again: the status renderer was scoped inside the tool closure, so every command invocation failed with `ReferenceError`.
32
+ - Remote observation rows (`pr`, `pr-activity`, `issues`) render readable notes with ackable forge references (`pr forgejo-lab#93 open "Title"`, `issues forgejo-lab: 3 open`) instead of an indistinguishable "pr changed" line that could never be acknowledged.
33
+ - Ref acknowledgement is held to the revision the model was actually presented (wake prefix or status details): a stale id acknowledges exactly its presented revision and keeps any newer unseen revision pending to re-report; a ref presented in no rendering this session refuses until status or a wake shows it. Restored entries acknowledge through their non-hash persisted id once presented. Ambiguous ids name their bounded candidates instead of advising the form that was refused.
34
+ - Assignment notes include the wire `state` (running/paused/done), degraded sources beyond the line budget group behind an omitted marker, and next actions never render an `undefined` acknowledgement id.
9
35
 
10
36
  ## [0.4.0] - 2026-11-12
11
37
 
data/README.md CHANGED
@@ -1,114 +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
- ## Mount-aware poll fallback
48
-
49
- `/lab/state/hitl-address/ace` (the HITL transport folder) is a FUSE/virtiofs
50
- mount where inotify event delivery is unreliable: a registered `/watch` never
51
- fires there. The watch port (`wake/watch-subscription.js`) classifies every
52
- watched target through a `statfsFn` port (`node:fs.statfsSync` by default;
53
- string fstype or Linux `f_type` magic number) and, for targets on unreliable
54
- mounts (virtiofs, fuse, fuseblk, fusectl), runs a 2.5 s reconcile timer that
55
- re-stats the aggregate fingerprint and wakes on change. `fs.watch` stays
56
- primary everywhere else; a failing or unsupported statfs keeps `fs.watch`
57
- primary rather than failing the watch.
58
-
59
- ## Ask bridge (the `ace-hitl ask` contract)
60
-
61
- `ace-hitl ask` is create + send + arm + END TURN: it never blocks and never
62
- polls. The asking agent's Ruby process drops one wake-request file into
63
- `<session cwd>/.ace-local/hitl/wake-requests/<case id>.json`:
64
-
65
- ```json
66
- {"schema": "ace.wake.ask/v1", "kind": "ask", "case_id": "8xhkep",
67
- "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
68
27
  ```
69
28
 
70
- The extension consumes that folder WITHOUT any agent turn activity
71
- (`wake/ask-bridge.js`, wired in `index.js` as `startAskBridge`): a small
72
- internal watch port anchors on the folder — or, while it does not exist yet
73
- (the first `ask` creates it), on its nearest existing ancestor and promotes
74
- itself once it appears — and its reconcile passes arm one scoped registry
75
- watch named `ask-<case id>` on the case file, then consume the request.
76
- When the answer lands (the Captain's reply flows through the transport into
77
- the case file), the case file's fingerprint changes and the wake fires with
78
- the `## Answer` section as its excerpt, so the wake carries the answer
79
- content; the agent acts immediately on wake. Arming is idempotent (an
80
- already-armed case consumes a stale request without re-arming, which would
81
- reset the baseline and could swallow a landed answer), an unreadable case
82
- file leaves the request pending, and the armed watch persists through
83
- reload/restart like any registry watch — nothing expires on the asker side.
84
- On unreliable mounts the armed watch fires only through the poll fallback
85
- above; that fallback is what makes ask work end to end there.
86
-
87
- ## 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
88
71
 
89
72
  ```sh
90
- 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
91
78
  ```
92
79
 
93
- Run from this directory. The glob covers the deterministic unit/acceptance
94
- suites only; the env-gated real-runtime acceptance in `test/acceptance/` is
95
- excluded and skipped when its environment is missing.
96
-
97
- Two environment caveats:
98
-
99
- - `test/report-wake-worktree.test.mjs` spawns this clone's `bin/ace-hitl`,
100
- which needs the repository's bundler setup and `ACE_TOOLCHAIN=auto` (the
101
- repo dev default). An inherited `ACE_TOOLCHAIN=installed` shell makes
102
- those two tests fail.
103
- - `test/acceptance/pi-sdk-acceptance.test.mjs` runs the extension inside the
104
- REAL Pi SDK runtime. It needs `PI_PKG_ROOT` (the pi-coding-agent package
105
- directory) and `EXT_PATH` (the published entrypoint
106
- `handbook/extensions/ace-wake/index.js`), and is normally driven by the
107
- ace-handbook-integration-pi feat harness
108
- (`bin/ace-test ace-handbook-integration-pi feat`):
109
-
110
- ```sh
111
- PI_PKG_ROOT="$(npm root -g)/@earendil-works/pi-coding-agent" \
112
- EXT_PATH="$PWD/handbook/extensions/ace-wake/index.js" \
113
- node --test test/acceptance/pi-sdk-acceptance.test.mjs
114
- ```
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)