colony-hermes 1.0.0__tar.gz

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.
Files changed (32) hide show
  1. colony_hermes-1.0.0/LICENSE +21 -0
  2. colony_hermes-1.0.0/PKG-INFO +368 -0
  3. colony_hermes-1.0.0/README.md +172 -0
  4. colony_hermes-1.0.0/colony_hermes.egg-info/PKG-INFO +368 -0
  5. colony_hermes-1.0.0/colony_hermes.egg-info/SOURCES.txt +30 -0
  6. colony_hermes-1.0.0/colony_hermes.egg-info/dependency_links.txt +1 -0
  7. colony_hermes-1.0.0/colony_hermes.egg-info/entry_points.txt +5 -0
  8. colony_hermes-1.0.0/colony_hermes.egg-info/requires.txt +10 -0
  9. colony_hermes-1.0.0/colony_hermes.egg-info/top_level.txt +2 -0
  10. colony_hermes-1.0.0/docs/HERMES-ADAPTER.md +349 -0
  11. colony_hermes-1.0.0/hostworker/colony_hostworker/catalog.py +754 -0
  12. colony_hermes-1.0.0/hostworker/colony_hostworker/contract.py +402 -0
  13. colony_hermes-1.0.0/plugins/colony-memory/SKILL.md +60 -0
  14. colony_hermes-1.0.0/plugins/colony-memory/__init__.py +64 -0
  15. colony_hermes-1.0.0/plugins/colony-memory/cli.py +180 -0
  16. colony_hermes-1.0.0/plugins/colony-memory/plugin.yaml +13 -0
  17. colony_hermes-1.0.0/plugins/colony-memory/provider.py +2470 -0
  18. colony_hermes-1.0.0/plugins/hermes-plugin/__init__.py +2459 -0
  19. colony_hermes-1.0.0/plugins/hermes-plugin/client.py +1779 -0
  20. colony_hermes-1.0.0/plugins/hermes-plugin/colony_hostworker/__init__.py +18 -0
  21. colony_hermes-1.0.0/plugins/hermes-plugin/commitment_work.py +122 -0
  22. colony_hermes-1.0.0/plugins/hermes-plugin/events.py +19 -0
  23. colony_hermes-1.0.0/plugins/hermes-plugin/evidence.py +76 -0
  24. colony_hermes-1.0.0/plugins/hermes-plugin/executions.py +119 -0
  25. colony_hermes-1.0.0/plugins/hermes-plugin/plugin.yaml +14 -0
  26. colony_hermes-1.0.0/plugins/hermes-plugin/request_memory.py +214 -0
  27. colony_hermes-1.0.0/plugins/hermes-plugin/review.py +60 -0
  28. colony_hermes-1.0.0/plugins/hermes-plugin/review_evaluation.py +226 -0
  29. colony_hermes-1.0.0/plugins/hermes-plugin/slash.py +34 -0
  30. colony_hermes-1.0.0/pyproject.toml +38 -0
  31. colony_hermes-1.0.0/setup.cfg +4 -0
  32. colony_hermes-1.0.0/setup.py +23 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aevonix
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,368 @@
1
+ Metadata-Version: 2.4
2
+ Name: colony-hermes
3
+ Version: 1.0.0
4
+ Summary: Native Hermes general and memory adapters for a Colony sidecar
5
+ License-Expression: MIT
6
+ Requires-Python: <3.14,>=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: httpx<0.29,>=0.27
10
+ Requires-Dist: httpcore<2,>=1
11
+ Requires-Dist: typer<1,>=0.12
12
+ Requires-Dist: PyYAML<7,>=6
13
+ Provides-Extra: test
14
+ Requires-Dist: build>=1.2; extra == "test"
15
+ Requires-Dist: pytest>=8; extra == "test"
16
+ Requires-Dist: setuptools>=77; extra == "test"
17
+ Requires-Dist: wheel; extra == "test"
18
+ Dynamic: license-file
19
+
20
+ # Native Hermes adapter distribution
21
+
22
+ `colony-hermes` packages the existing general adapter and memory provider for
23
+ installation into the Python environment that runs Hermes. The Colony sidecar
24
+ is a separate service. The adapter does not install the sidecar, a context
25
+ engine, a worker daemon, or operating-system services.
26
+
27
+ Build from the repository root:
28
+
29
+ ```sh
30
+ python -m pip install build
31
+ python -m build
32
+ ```
33
+
34
+ Install the resulting wheel with the Python interpreter that runs Hermes:
35
+
36
+ ```sh
37
+ python -m pip install dist/colony_hermes-1.0.0-py3-none-any.whl
38
+ ```
39
+
40
+ The wheel exposes `colony` through `hermes_agent.plugins` and `colony-memory`
41
+ through `hermes_agent.memory_providers`. It maps the canonical source files in
42
+ `plugins/hermes-plugin/` and `plugins/colony-memory/` to importable packages.
43
+ Only `catalog.py` and `contract.py` from `hostworker/colony_hostworker/` are
44
+ included in the adapter's private catalog package. Source-checkout plugin paths
45
+ and the existing installer's copying behavior remain compatible.
46
+
47
+ ## Activation and current limits
48
+
49
+ Installing the wheel makes the adapters discoverable. It does not change a
50
+ Hermes profile, select a memory provider, or enable tools. Activation requires
51
+ the existing general-adapter configuration, `plugins.enabled: [colony]`, and
52
+ `memory.provider: colony-memory` in the selected private profile. Preserve
53
+ other enabled plugins when editing that list. The existing coexistence settings
54
+ are also required in the Hermes process environment:
55
+
56
+ ```sh
57
+ COLONY_GENERAL_PLUGIN_ACTIVE=1
58
+ COLONY_MEMORY_WORKER_TOOLS=0
59
+ COLONY_MEMORY_TURN_WRITER=disabled
60
+ ```
61
+
62
+ Configure the sidecar URL and contact through native `hermes memory setup`
63
+ and matching `plugins.colony` configuration, and supply `COLONY_API_KEY` privately.
64
+ Native setup stores non-secret fields in the selected profile's
65
+ `colony-memory.json`, which overrides legacy `memory.config`. The
66
+ general adapter needs a private writable turn outbox and verified participant
67
+ bindings. Consequential tools retain their existing mediator requirements.
68
+ This packaging change does not provision those dependencies.
69
+
70
+ Do not silently replace a selected external memory provider. Existing
71
+ directory installations also need explicit migration: Hermes gives directory
72
+ memory providers precedence over pip providers, while a pip general plugin can
73
+ override a same-name directory plugin. Remove or archive obsolete plugin
74
+ directories only as part of an intentional profile migration.
75
+
76
+ When the memory provider is selected, native CLI discovery exposes
77
+ `hermes colony-memory status`, `goals`, `context`, and `sync`. These commands
78
+ resolve the same selected profile settings and credentials as the provider;
79
+ explicit URL/contact arguments remain available. The Typer app remains available
80
+ to existing callers.
81
+
82
+ Profile settings and handoff files stay scoped to the selected Hermes home.
83
+ The provider remains attached through a sidecar startup outage and retries on
84
+ later requests. Automatic profile activation remains follow-up work; packaging
85
+ alone does not establish production readiness.
86
+
87
+ ## Durable source capture
88
+
89
+ The native memory provider implements compression checkpoint API v2. Set
90
+ `compression.checkpoint_required: true` to make Hermes retain its transcript
91
+ when local checkpoint persistence fails. A successful checkpoint commits the
92
+ normalized direct source messages into the same private SQLite outbox used by
93
+ the general adapter. The callback then attempts delivery within 250 ms.
94
+ Sidecar downtime leaves a pending durable record and permits compression;
95
+ pending does not mean centrally recallable. Diagnostics expose checkpoint
96
+ state. The ordinary turn writer and subsequent checkpoints drain that outbox.
97
+
98
+ The outbox accepts at most 8 MiB of serialized data per record. Oversized or
99
+ unserializable evidence fails explicitly without clipping it. System rows,
100
+ tool wrappers, compression summaries and injected `api_content` are excluded.
101
+ Direct message content, including media references, is retained. The general
102
+ turn writer also retains complete messages instead of cutting at 2,000
103
+ characters. New records require a `source_recorded` receipt before delivery is
104
+ acknowledged, so an older sidecar cannot silently discard an unfamiliar
105
+ checkpoint payload during an upgrade.
106
+
107
+ The existing `/v2/host/turns/{turn_id}` endpoint stores direct source JSON and a
108
+ lexical index transactionally in `turn-idempotency.db`. Checkpoints bypass
109
+ ordinary interaction, affect, graph and initiative effects. Replays do not
110
+ create another source. `occurred_at` is retained when supplied explicitly in
111
+ context metadata; otherwise it is unknown. Server `ingested_at` is separate
112
+ and is never treated as the date asserted by the conversation.
113
+
114
+ `/v1/host/context/assemble` reads the source index after the existing exact
115
+ viewer check. Ordinary attributed turns can be recalled across that person's
116
+ sessions. Full-history checkpoints additionally require their original session,
117
+ because the native history does not guarantee old per-message speaker
118
+ attribution. Media references remain source data; only text is indexed. This
119
+ is direct evidence recall, not an embedding migration or a belief contradiction
120
+ engine.
121
+
122
+ ## Source erasure and replay
123
+
124
+ `POST /v1/host/memory/sources/forget` accepts an authenticated contact and 1 to
125
+ 100 canonical source IDs. The existing MCP server exposes `colony_forget_sources`.
126
+ Native Hermes committed memory removes also attempt an exact, session-bound
127
+ `old_text` match, including when the general plugin owns ordinary turn writes.
128
+ No match or multiple matches produces an explicit unmapped/ambiguous diagnostic;
129
+ it never broadens a text search into deletion. IDs unknown to the central source
130
+ store are rejected. Pending-only local evidence needs to be identified at its host.
131
+
132
+ Erasure commits source-ID and exact-message hashes before cleaning linked graph
133
+ summaries. Checkpoint copies are redacted within the same contact and session;
134
+ unrelated messages remain. New graph summaries carry `source_uri=turn:<id>` and
135
+ `source_turn_id`. Projection markers block late writes and reads while deletion
136
+ is pending. The response separates source erasure from graph cleanup and host
137
+ reconciliation. A repeated request retries the same derived cleanup targets.
138
+
139
+ The host outbox migrates its existing v1 database transactionally to v2 with a
140
+ separate contact-bound erasure watermark. Canonical turn/checkpoint delivery
141
+ fetches `/v1/host/memory/sources/erasures` before PUT. A missing endpoint, outage,
142
+ incomplete page or server history behind the host cursor holds replay. The host
143
+ purges both pending payloads and delivered receipts, preserving unrelated pending
144
+ messages as evidence-only checkpoints. Erased IDs cannot be enqueued again after
145
+ reconciliation. This is not a model-generation counter. Generic caller-provided
146
+ outbox delivery callbacks must use `ColonyClient.sync_turn(..., outbox=outbox)`
147
+ to participate in reconciliation.
148
+
149
+ This is scoped source erasure, not a claim of global forgetting. Native Hermes
150
+ transcripts/API context, backups, prior graph records without source lineage,
151
+ legacy shared facts, ToM, commitments, and other old derivative stores need their
152
+ own erasure adapters. Offline hosts retain bytes until reconnecting; filesystem
153
+ snapshots and physical-media remnants are outside this logical-delete contract.
154
+ Erasure history must survive backup restores; replay detects an older watermark
155
+ but cannot prove that a replaced server with reused sequence numbers is equivalent.
156
+
157
+ ## Qualification
158
+
159
+ Pull-request CI keeps an exact qualified Hermes commit pinned. The separate
160
+ `Latest Hermes compatibility` workflow runs daily and can be dispatched manually.
161
+ It selects the latest published stable upstream release, records its exact Git
162
+ commit and runs the same built-artifact/native-profile tests. It uses disposable
163
+ profiles and controlled inference, without deployment credentials or a live
164
+ agent. A compatibility failure leaves production and the qualified pin intact.
165
+
166
+ When a new upstream release passes, update the pin in an ordinary reviewed
167
+ change and qualify the deployment's actual channels and recovery before moving
168
+ that deployment. The scheduled result catches upstream drift; it does not
169
+ establish production readiness or automatically upgrade a running agent.
170
+
171
+ The qualification target is Hermes v0.21.0, tag `v2026.8.31`, commit
172
+ `29112bef099274229cadff79cdff7bf7b99c4b77`, tested on Python 3.12. The package
173
+ allows Python 3.11 through 3.13; those other interpreters are not yet qualified.
174
+ Other Hermes
175
+ releases are unqualified until the native-loader checks pass against them.
176
+ Hermes is installed separately; this package does not select or upgrade it.
177
+
178
+ Install test dependencies into an isolated environment with the target Hermes
179
+ checkout available, then run:
180
+
181
+ ```sh
182
+ python -m pip install build pytest "setuptools>=77" wheel
183
+ python -m pytest tests/hermes_adapter -q
184
+ ```
185
+
186
+ The tests build a wheel and a source distribution, rebuild from the source
187
+ distribution, install the wheel outside the checkout, and exercise the actual
188
+ Hermes general and memory loaders. Native-loader tests require Hermes and
189
+ are explicitly skipped when it is absent. No live sidecar, model endpoint,
190
+ production profile, or channel is contacted.
191
+
192
+ ## Shared execution observations
193
+
194
+ On the qualified Hermes v0.21.0 release (`v2026.8.31`, commit
195
+ `29112bef0992`), set `plugins.colony.execution_registry_enabled: true` to
196
+ publish native turn, API, tool and delegated-child lifecycle observations.
197
+ This is opt-in for existing installations. The adapter credential must already
198
+ have scoped `turns:write` and exact person grants; `context:read` grants access
199
+ to the corresponding view. The legacy global bearer does not attest identities
200
+ for this new surface. To observe trusted agent cron fires, include `cron` in
201
+ the existing `attested_system_platforms` configuration; it is not enabled by
202
+ the adapter's default `cli` binding. No network call is made during registration.
203
+
204
+ Colony stores only execution IDs, participant/session linkage, channel, phase,
205
+ tool name and observation times in the existing `turn-idempotency.db`. It does
206
+ not copy prompts, tool arguments/results or task descriptions. Each hook has a
207
+ 400 ms network deadline and failures do not stop a turn. Ordinary use supplies
208
+ new observations at API/tool boundaries; there is no heartbeat thread. After
209
+ 120 seconds without an observation, liveness is **unknown**, including during
210
+ a long model response. A terminal native turn event closes its observation;
211
+ late events cannot reopen it. Metadata older than seven days is hidden from
212
+ the view and removed during subsequent observation writes.
213
+
214
+ `GET /v1/host/executions?contact_id=<bound-person>&session_id=<session>` returns
215
+ the scoped view with age, coverage and truncation fields. The owner, identified
216
+ by server configuration and an existing exact person grant, can see registered
217
+ turns across sessions. Other people can see only their own selected session;
218
+ public/guest turns receive no automatic registry injection. The owner's normal
219
+ context assembly includes up to eight observations when present.
220
+
221
+ The native `subagent_start` event binds each executing child to the exact
222
+ observed parent turn. Child observations inherit that participant and cannot
223
+ broaden it. Observation does not grant tool authority; the separate enforcement
224
+ below also works when observation is disabled. No model argument selects the
225
+ writer or owner role.
226
+
227
+ The view observes running Hermes turns, including agent cron fires and
228
+ executing subagents, and reads claimed/running workers from the canonical task
229
+ queue for the owner. It also reads native cron attempts, including script-only
230
+ jobs, from one explicitly bound Hermes profile. The sidecar uses its private
231
+ local-instance manifest or explicit `HERMES_HOME`; it never scans other profiles
232
+ or assumes a default home. A conflicting binding is unavailable. The existing
233
+ CLI-managed service supplies the same private home automatically.
234
+
235
+ The cron projection reads `cron/executions.db` without importing or running the
236
+ native scheduler, initializing its schema, or rewriting its status. It returns
237
+ native execution/job IDs, a hashed source-home identity, optional job names,
238
+ record timestamps and claimed/running status, plus a bounded day of recent
239
+ completed/failed/unknown records. Prompts, scripts, output, errors and credentials
240
+ are excluded. No observation writer or polling daemon is added. Native recorded
241
+ running state has **unknown process liveness**, however recent it is. Only
242
+ Hermes can reconcile abandoned attempts; completed records do not prove a
243
+ third-party effect. Guests receive no native cron rows. Missing, incompatible
244
+ or unreadable ledgers are explicitly unavailable, and `complete` is always
245
+ false for the combined work view.
246
+
247
+ Qualification fires a due native `no_agent` job in a disposable profile with
248
+ `deliver=local`, observes the same execution ID during and after actual script
249
+ completion, and checks the persisted output. This does not depend on an empty
250
+ `enabled_toolsets`, which Hermes treats as its default tool selection. A separate
251
+ installed-wheel test runs actual native parent and child turns with controlled
252
+ inference, reads a neutral local file, delivers the asynchronous completion
253
+ through the native CLI ownership filter, and resumes the parent. A foreign
254
+ session cannot consume that completion; a guest child retains guest tool limits.
255
+ These tests do not contact a model endpoint or a production profile.
256
+
257
+ The view still does not cover queued children,
258
+ unregistered external coding processes or every hardware service.
259
+ It does not enforce atomic free-text conversational commitments. The optional
260
+ [explicit shared undertaking](COMMITMENT-WORK.md) coordinates work against an
261
+ existing person commitment ID in its durable store. Seeing concurrent work is a prerequisite
262
+ for coordination, not a guarantee that promises cannot conflict.
263
+
264
+ ## Native tool authority
265
+
266
+ On the qualified Hermes release, the general plugin enforces participant
267
+ authority at native `tool_execution` middleware. Resolved owner turns and
268
+ explicitly configured local system platforms retain native tools and existing
269
+ Hermes toolset, approval and guardrail checks. Guests cannot directly invoke
270
+ shell, files, network, devices, coding, delegation, native memory/session tools,
271
+ or unknown plugin/MCP tools. The exact Colony tools keep their existing scoped
272
+ read checks and action mediators. No arbitrary tool prefix or relationship
273
+ score grants access.
274
+
275
+ A native-tool request from a guest returns `requires_authorization`, with no
276
+ effect and no approval created. The response directs the agent to an enabled
277
+ Colony action request or the owner. It does not invent an approval request or
278
+ permit a raw tool after conversational consent. Broader guest capabilities
279
+ require a scoped mediated interface; this packet supplies none automatically.
280
+
281
+ Authority uses the transport-resolved participant bound to the exact native
282
+ session/task/turn, never fields in model arguments. A native child-spawn event
283
+ binds the child to the exact parent's authority. Missing or conflicting parent
284
+ bindings cannot acquire the local CLI system role. Native pre-API callbacks
285
+ retain that binding across compression session rotation. Coding RPC calls use
286
+ Hermes' propagated execution context, without a process-global last-owner or
287
+ task-only lookup. Unavailable identity returns an explicit error because
288
+ Hermes middleware exceptions otherwise fail open. Local trusted CLI remains
289
+ available when contact resolution is offline; remote identity is not guessed.
290
+
291
+ This is a boundary for model-requested tool dispatch while the general plugin
292
+ is loaded. It does not sandbox trusted installed plugin code, remove private
293
+ facts already present in old transcripts/system prompts, or replace the
294
+ deployment's channel admission, secret isolation and consent policy. Native
295
+ owner tools retain their existing consent behavior; they are not converted to
296
+ Colony intents by this gate. Qualify both owner and guest messages before
297
+ enabling a public channel.
298
+
299
+ ## Native post-turn review
300
+
301
+ Hermes' automatic review reuses its parent's session ID without emitting a
302
+ subagent-start event. The adapter captures the exact parent participant on the
303
+ native caller thread and accepts inheritance only with Hermes' trusted review
304
+ provenance, matching parent/session, and a distinct task/turn. Later speakers in
305
+ the same session cannot upgrade a queued guest review. Reviews get a separate
306
+ work record linked to their parent, do not replace the session's current speaker,
307
+ and do not write their internal harness into ordinary conversation evidence.
308
+
309
+ For owner/system reviews, `skill_manage` produces a proposal in Hermes' existing
310
+ `pending/skills` store. Native curator ownership checks still apply. Foreground
311
+ owner requests retain native behavior. The proposal is not an evaluated or
312
+ activated improvement: an explicit operator or a separately configured task
313
+ evaluator must use the native apply path. Mutation history and rollback remain
314
+ in Hermes' skill ledger. No new consent transport or learning store is added.
315
+
316
+ Installed-wheel qualification runs real native automatic review threads with
317
+ controlled inference for owner and guest, including a later-owner race in the
318
+ guest's session. It checks proposal persistence, exact inherited authority,
319
+ separate work observation, absent harness capture, and explicit native
320
+ apply/ledger rollback. It does not claim measured task improvement from that
321
+ controlled model fixture.
322
+
323
+ ### Measured skill updates
324
+
325
+ `python -m colony_hermes.review_evaluation --skill NAME --pending ID
326
+ --oracle trusted_local_module:function` evaluates one explicitly selected,
327
+ existing curator-owned `SKILL.md` proposal. It accepts native full-content
328
+ edits or exact text patches, including a one-operation native batch. Text
329
+ patches must match their captured original content without ambiguity unless
330
+ native `replace_all` is explicit. Support-file changes, multiple-operation batches,
331
+ new skills and unrelated proposals stay in Hermes' ordinary pending mechanism.
332
+ The selected local oracle is trusted operator code, not a model tool or a
333
+ model-selected command. It receives the playbook text and a phase and must bound
334
+ its own task execution. It returns explicit case IDs and boolean outcomes.
335
+
336
+ Baseline and candidate must run the same cases; every candidate case must pass
337
+ and at least one must improve. The adapter records task evidence, the proposal
338
+ hash, oracle identity and before/candidate files in the native skill ledger,
339
+ then calls native apply. It repeats the task after activation, permitting
340
+ additional held-out checks while requiring all original cases. A failed or
341
+ unavailable initial check invokes native rollback. `--audit EVALUATION_ID` repeats
342
+ an existing candidate check later, using the same oracle implementation. Once
343
+ the ledger records a completed activation, an unavailable later audit records
344
+ `unavailable` and retains the last qualified files. A completed task regression
345
+ still invokes native rollback. Infrastructure failure is not a failed task case. This is
346
+ an operator/cron entry point, not an additional background service.
347
+
348
+ The proposal records its original file hash. A stale proposal or later owner
349
+ edit is held rather than overwritten. A candidate ledger entry is written
350
+ before apply and remains a recovery target if the process exits between apply
351
+ and evaluation; retrying the pending ID resumes its post-check. Rollback checks
352
+ all captured current files against the candidate snapshot first and restores
353
+ only native skill files. It does not rewind memory, permissions or action
354
+ records. These byte checks do not lock editors or foreign processes, so select
355
+ a curator-owned path without another concurrent writer for automatic rollout.
356
+ Native curation usage counters remain native telemetry after file rollback.
357
+
358
+ Qualification tests exercise real pending files, native curator ownership,
359
+ mutation/rollback and ledger recovery with controlled task outcomes. A selected
360
+ oracle only establishes performance on its declared task cases. No evaluator
361
+ or automatic rollout is enabled by default, and this contract does not qualify
362
+ arbitrary code changes or prove general self-improvement.
363
+
364
+ A disposable local-inference qualification also exercised an actual native
365
+ review and exact text patch: its declared task scored 0/2 before, 2/2 with the
366
+ candidate, and 2/2 after activation. An injected evaluator outage restored the
367
+ original bytes through native rollback. This was a neutral fixture, not a live
368
+ recurring skill or an observed spontaneous model regression.
@@ -0,0 +1,172 @@
1
+ # Colony
2
+
3
+ Persistent memory and shared work for a personal agent, using your own models.
4
+
5
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+ [![CI](https://github.com/Aevonix/ColonyAI/actions/workflows/ci.yml/badge.svg)](https://github.com/Aevonix/ColonyAI/actions/workflows/ci.yml)
7
+
8
+ Colony runs beside [Hermes](https://github.com/NousResearch/hermes-agent).
9
+ Hermes handles conversations, tools, scheduling and delegation. Colony retains
10
+ what happened, assembles relevant evidence before a turn, and shares commitments
11
+ and work across sessions. Your private deployment supplies its identity,
12
+ credentials, channels and hardware adapters.
13
+
14
+ Colony 1.0 supports native Hermes attachment, durable source memory, scoped
15
+ recollection and shared work. Optional image and semantic projections, a bounded
16
+ working perspective, and evaluated native skill updates extend that core. These
17
+ paths have executable qualifications; model quality and each deployment's
18
+ configuration still determine their results.
19
+
20
+ The lightweight installation starts with memory and observation. Extended
21
+ autonomy loops, public channels, voice systems and hardware need explicit
22
+ deployment integration and their own behavioral checks. Version 1.0 does not
23
+ claim complete autonomy, a complete view of every process, or subjective feelings.
24
+
25
+ ## Start with Hermes
26
+
27
+ The qualified runtime is Hermes 0.21.0. Use its Python interpreter for attachment;
28
+ Python 3.12 is exercised by native integration CI. One local OpenAI-compatible
29
+ chat endpoint is sufficient. The lightweight profile needs no Docker, Neo4j,
30
+ embedding model or external account.
31
+
32
+ Install from this checkout to use the changes described here:
33
+
34
+ ```bash
35
+ python -m pip install . ./sidecar
36
+ colony init --hermes-python /path/to/hermes/.venv/bin/python
37
+ ```
38
+
39
+ The wizard selects a Hermes home, asks for your name, agent name and model, and
40
+ creates private state outside Git. It preserves existing identity, channels and
41
+ model settings. Replacing an incumbent memory provider is an explicit choice.
42
+ It attaches the canonical installed adapter when its bytes match, or installs
43
+ profile directory adapters when no native package is present. It neither
44
+ patches Hermes core nor restarts an existing gateway.
45
+
46
+ Accept the wizard's startup option, or run:
47
+
48
+ ```bash
49
+ colony --instance /path/to/private/colony start --detach
50
+ colony --instance /path/to/private/colony status
51
+ ```
52
+
53
+ Start a new Hermes session, give it a harmless fact, then ask for that fact in a
54
+ second session. The [setup guide](docs/LOCAL-HERMES-SETUP.md) explains existing
55
+ profiles, unattended flags, startup and recovery. The minimum profile remembers
56
+ and observes. Consequential background execution requires deliberate setup.
57
+ For login startup and automatic process recovery, stop a detached instance and
58
+ run `colony --instance /path/to/private/colony service install`, then
59
+ `colony --instance /path/to/private/colony service start`. Linux systemd user
60
+ services and macOS LaunchAgents use the selected environment and private state.
61
+ This follows the user session's lifetime, not a guarantee of operation before
62
+ login. See the setup guide for status, stop, uninstall and recovery.
63
+
64
+ ## What the active paths provide
65
+
66
+ - **Automatic recollection.** The native memory provider requests context for
67
+ the current participant, session and question before inference. A durable
68
+ outbox captures ordinary turns; retry does not create another source.
69
+ - **Scoped source recall.** Authenticated participants can recall their own
70
+ canonical evidence without the legacy graph runtime. Optional semantic
71
+ projections find retained passages and image descriptions, then resolve them
72
+ back to current sources before selection. [Source retrieval](docs/SOURCE-SEMANTIC-RECALL.md)
73
+ - **Evidence that outlives a model.** Original messages, timestamps, provenance
74
+ and derived claims persist independently of inference weights. Corrections
75
+ and conflicting claims remain inspectable. [Source claims](docs/SOURCE-CLAIMS.md)
76
+ - **Selective factual learning.** One extractor promotes useful, quoted
77
+ assertions. Routine logs remain source history, without duplicate graph
78
+ summaries or automatic contact-knowledge guesses. [Memory quality](docs/MEMORY-QUALITY.md)
79
+ - **Images with origins.** Retained image bytes and model-generated descriptions
80
+ stay distinct. Recollection can include the description and a scoped reference
81
+ to its source. This does not imply reliable understanding of every image.
82
+ [Image memory](docs/SOURCE-IMAGES.md)
83
+ - **Shared work.** Sessions can observe commitments and claim work through one
84
+ persistent registry. Another session sees who holds it. A lease coordinates
85
+ work; it cannot by itself make an external side effect exactly once.
86
+ [Commitment work](docs/COMMITMENT-WORK.md)
87
+ - **Replaceable search indexes.** Optional Lance indexes record embedding
88
+ identity and rebuild into a separate generation. Interrupted rebuilds resume;
89
+ incompatible or unknown vectors are not compared. Canonical evidence remains
90
+ available through lexical recall. [Embedding generations](docs/EMBEDDING-GENERATIONS.md)
91
+ - **Source-linked forgetting.** Erasure fences source evidence immediately and
92
+ removes linked fact, graph and vector projections. Cleanup status is explicit.
93
+ Unlinked historical records, host transcripts and backups require additional
94
+ reconciliation. [Derived fact lineage](docs/TOM-SOURCE-LINEAGE.md)
95
+ - **Inspectable priorities.** Source-backed owner corrections and measured
96
+ outcomes can change optional research ordering. The dated attention snapshot
97
+ records the evidence and applied weights. This is a bounded working
98
+ perspective, not a claim of subjective feelings.
99
+ [Working perspective](docs/WORKING-PERSPECTIVE.md)
100
+ - **Evaluated skill updates.** Native Hermes review can stage a proposal for an
101
+ existing skill. An explicitly selected task evaluator compares the current
102
+ skill and candidate, verifies activation and uses native rollback for a
103
+ measured regression. Deployments supply their own task cases and activation
104
+ policy. [Native skill review](docs/HERMES-ADAPTER.md#measured-skill-updates)
105
+ - **Source recovery.** Backups capture consistent individual SQLite databases
106
+ and the original images owned by their source ledger. Restore verifies the
107
+ captured images and restores SQLite through its backup API. Coverage and
108
+ cross-store limits are explicit. [Memory recovery](docs/SOURCE-MEMORY-RECOVERY.md)
109
+
110
+ ## Architecture and extension
111
+
112
+ One sidecar owns canonical state and a bounded context selector. SQLite supports
113
+ the minimum deployment. Neo4j remains the extended deployment's legacy memory
114
+ store; Lance is a replaceable search projection. Legacy graph records are not
115
+ yet fully reconstructible from canonical sources. There is no database service
116
+ per cognitive feature.
117
+
118
+ The Hermes adapter uses native plugin and memory-provider contracts. Other hosts
119
+ can use the HTTP API, with participant identity supplied by an authenticated
120
+ adapter. Device protocols, continuous audio, camera capture and private identity
121
+ belong in deployment adapters rather than public cognition code.
122
+
123
+ Named model roles choose eligible local endpoints and fallbacks. Runtime reload,
124
+ configured endpoint advertisements and completion availability let later requests
125
+ follow changed bindings. Changing a processor does not replace the agent's
126
+ memories or identity. Automatic fleet enrollment, capacity scheduling and empirical
127
+ model selection remain separate work.
128
+ [Function routing](docs/FUNCTION-ROUTING.md)
129
+
130
+ See [architecture and ownership](docs/ARCHITECTURE.md) before adding a component.
131
+ Every addition should close an observable loop, have one state owner, and reuse
132
+ Hermes facilities where they already fit. Self and relationships are explicit
133
+ state, not evidence of subjective feelings. Relationship scores must not grant
134
+ privileged capabilities.
135
+
136
+ ## Operation and limits
137
+
138
+ Consequential actions need owner authorization. Authorization belongs to the
139
+ work being approved; losing a notification should not discard a build or its
140
+ result. The lightweight installer does not enable external-effect workers.
141
+ Existing extended deployments must inspect their actual resolved configuration
142
+ at `GET /v1/host/autonomy/posture` before enabling another loop.
143
+
144
+ The [known gaps](docs/KNOWN-GAPS.md) inventory includes legacy components that
145
+ are partial, dormant or awaiting replacement. They are outside the supported
146
+ core until their deployment loops are qualified. Shared observations do not
147
+ prevent every conflicting promise; a selected skill evaluator does not establish
148
+ general self-improvement. Source forgetting does not rewrite arbitrary old
149
+ transcripts, unlinked paraphrases or backups. See the
150
+ [native request boundary](docs/NATIVE-REQUEST-ERASURE.md) for its exact scope.
151
+
152
+ ## Development
153
+
154
+ Install the sidecar development dependencies, then run its tests from `sidecar`:
155
+
156
+ ```bash
157
+ python -m pip install -e './sidecar[dev]'
158
+ cd sidecar
159
+ python -m pytest -q tests colony_sidecar
160
+ ```
161
+
162
+ `tests/hermes_adapter` qualifies built packages against the pinned native
163
+ Hermes runtime. Its controlled model fixture verifies integration, not model
164
+ quality. Deployment acceptance also needs real inference, source receipts,
165
+ cross-session behavior and recovery with the actual configuration.
166
+
167
+ Keep personal data, endpoint coordinates, secrets and deployment configuration
168
+ out of public examples, commits and test artifacts.
169
+
170
+ ## License
171
+
172
+ [MIT](LICENSE). Optional dependencies retain their own licenses.