@staix/agent-hub 0.41.0 → 0.42.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ Issue and pull request numbers in the entries for 0.7.7 and earlier refer to the
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 0.42.0
8
+
9
+ - Release N-1 for 0.42.x is published 0.41.0, with exact agent-mem 0.27.1 and control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0. The isolated fixture exercises old client and plugin against the new daemon and the new client and plugin against the old daemon. It does not establish live-agent, rollback or shared-home compatibility. The wire is unchanged from 0.41.0. This release pins agent-mem 0.28.0 while 0.41.0 pins 0.27.1; agent-mem 0.28.0 raises no sync/home format floor, so both can share a memory home until a person raises it, and file compatibility beyond these fixtures remains subject to the release verification report.
10
+ - `ahub help memory` and the memory docs no longer call memory changes, `sync`, `import`, `decay` and `declined` person-only; an agent shell runs them as itself since hub task 969 (#1522). `graph`, `confirm`, `reject` and `profile-check` stay the person's.
11
+ - Agent shells can run the supported `ahub memory` commands with their own attribution (hub task 969, Refs #1522). Memory writes retain the existing policy and confirmation checks and record the agent; person-only hub verdicts stay restricted. The implementation uses agent-mem's public attribution API.
12
+ - The hub exact-pins `@staix/agent-mem` 0.28.0 (hub task 988, from 0.27.1). Candidates gain a nullable `origin` column that agent-mem fills from the optional `origin()` option of `createMemoryMcp`, which the hub does not set, so no candidate gets an origin from the hub. Placement sync can batch its journal appends only after a person raises the sync/home format floor to 0.28.0; no floor is raised implicitly, so behavior is unchanged until then. The N-1 compatibility baseline is 0.27.1. Package, lockfile integrity, the pin sentences in the docs and the plugin bundles move together. This is not a release.
13
+
7
14
  ## 0.41.0
8
15
 
9
16
  - Release N-1 for 0.41.x is published 0.40.0, with exact agent-mem 0.26.3 and control protocol 17 (descriptor floor 16). The N-1 fixture and matrix pin that package; the separate protocol-16 fixture stays at 0.25.0. The isolated fixture exercises old client and plugin against the new daemon and the new client and plugin against the old daemon. It does not establish live-agent, rollback or shared-home compatibility. The wire is unchanged from 0.40.0. This release pins agent-mem 0.27.1 while 0.40.0 pins 0.26.3; file and format-floor compatibility beyond these fixtures remains subject to the release verification report.
package/README.md CHANGED
@@ -5,7 +5,7 @@ Code, Codex, Kimi Code, Pi and a hub-owned local worker (plus Qwen Code, Jcode a
5
5
  Antigravity if you want them) share a message bus, a task board and a memory, each
6
6
  connected through its own native interface.
7
7
 
8
- Status: 0.41.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
8
+ Status: 0.42.0, control protocol 17 (accepts 16). Bun + TypeScript, one loopback daemon per
9
9
  project. Site: [agent-hub.staix.net](https://agent-hub.staix.net).
10
10
 
11
11
  Inspect bounded task and attempt metadata with `ahub lineage show`; admit external
@@ -6,7 +6,7 @@ Status 2026-10-12: keep optional. No measured effect yet.
6
6
 
7
7
  - Through the hub: nothing at runtime. Session-start recall, task briefs, the local worker's capture and `hub_remember` all use the in-process amem store (`@staix/agent-mem`); the hub makes no claude-mem worker request and ignores `memory.worker_url` (`ahub doctor`: "in-process, no claude-mem worker").
8
8
  - Native plugin: claude-mem installed as a Claude Code or Codex plugin runs its own hooks inside those sessions; the hub neither reads nor writes them. The add-on fingerprint records it when it is enabled there, so `ahub research addons` and `ahub bench run --addon claude-mem=on|off` can compare on against off.
9
- - Import: `ahub memory import claude-mem` is a person's one-way, read-only copy of past hub observations into hub memory (`docs/memory.md`). The bench memory arms `claude-mem` and `both` are historical labels for `memory.enabled`, not a live claude-mem path.
9
+ - Import: `ahub memory import claude-mem` is a one-way, read-only copy of past hub observations into hub memory (`docs/memory.md`). The bench memory arms `claude-mem` and `both` are historical labels for `memory.enabled`, not a live claude-mem path.
10
10
 
11
11
  ## Evidence
12
12
 
package/docs/dogfood.md CHANGED
@@ -145,7 +145,7 @@ agent-hub is developed with agent-hub. This page lists every feature, whether it
145
145
 
146
146
  | Feature | State here | Measured by |
147
147
  | --- | --- | --- |
148
- | amem runtime integration (agent-mem#13 P4) | on after release; no claude-mem worker dependency; 0.27.1 search grouping is fixture-tested, live rollout unverified | no-worker tripwire requests (must be 0), screened capture rows, profile refusals, all-author short-term recall, bounded-view truncation notices and curated-only ask citations; `test/memory-grouping.test.ts` checks grouped and ungrouped CLI search and the unchanged daemon tool |
148
+ | amem runtime integration (agent-mem#13 P4) | on after release; no claude-mem worker dependency; 0.27.1 search grouping and agent-shell attribution are fixture-tested, live rollout unverified | no-worker tripwire requests (must be 0), screened capture rows, profile refusals, all-author short-term recall, bounded-view truncation notices and curated-only ask citations; `test/memory-grouping.test.ts` checks grouped and ungrouped CLI search and the unchanged daemon tool; `test/memory-agent-shell.test.ts` reads agent-attributed writes and checks person-only refusals |
149
149
  | Shared memory through amem, briefs, recall preface | on; library intent briefs and plan guard (#436) take effect after release and hub upgrade; legacy index/timeline reads and worker notices retire in intent mode | notes saved per week, brief hits, fails that prevented a retry; the session preface's bytes and memory lines per session and how many were reordered by observed use (`preface` events, `events.preface` in `quality.json`, #1330; the cited share is the existing per-task `memory` block's `cited` over `rendered`, which covers briefs and prefaces together, not a preface-only per-session share); same-input hub/library brief equality, host privacy refusals and front-of-brief plan fails despite the library byte cap or standalone screen |
150
150
  | `ahub ask` | on | answers with cited ids |
151
151
  | Source registry, `ahub source add\|list` (#508 AC1, AC2, AC5 CLI) | on after release; local (no daemon needed for the person); `add` is the person's or the configured conductor's (#933, admitted and audited by the hub); `hub_source_read` adds bounded, screened snapshots and private stubs; plan sources are registry-validated on proposal/acceptance, and the dashboard Plan sheet lists allowlisted source metadata (#1144) | `ahub source list` rows (id, size, private, origins); `sources/` under the hub state dir; a refusal in the CLI audit for an agent shell; unknown-plan-source refusals and metadata-only dashboard snapshot tests (#1144) |
package/docs/memory.md CHANGED
@@ -100,7 +100,7 @@ A running hub syncs 5 seconds after start and every `memory.sync_interval_min` m
100
100
  - **Session-start recall**: this project's long-term decisions, contracts and fails (and shared ones) lead the recall block; display-only filtering omits automatic approval notes, while changes-requested notes show their nonempty reasons. Lines preserve their headers and end at word boundaries with a visible marker when capped; each delivery deduplicates memory ids across prefaces and note lines. Stored notes and brief evidence are unchanged. Recent short-term amem curated notes follow; each gets half of `memory.inject_tokens` when both answer. The long-term section is ordered by observed use (#1330): the sidecar's `delivered` and `cited` counter rows are per delivery, so they are summed per entry; entries with a cited share lead (highest share first), entries with no observed use keep the store's newest-first order, and entries delivered at least `memory.preface_unused_after` times (default 20) and never cited move to the end of the section, so the display cap cuts them first. An entry with null counters, no sidecar, an unreadable sidecar or `memory.preface_unused_after = 0` keeps today's order: unknown is never read as zero. Nothing is deleted or demoted by this (demotion is proposed by agent-mem and accepted by a person), the short-term amem section keeps its store order (the client builds that text), and the setting applies at the next session start. Each preface records one `preface` event (bytes, memory lines, whether it was reordered) and `quality.json` totals them under `events.preface`.
101
101
  - **`ahub ask`**: entries that match the question and the graph neighbourhood of what they are about are evidence, cited
102
102
  as `[mem:<8 hex>]` for existing native projections or `[mem:<32 hex>]` for full entry references. A question that carries PII skips them. `ahub ask --remember` writes a pending candidate, never curated evidence; a person must review it.
103
- - **`ahub memory`** needs no running hub. The hub CLI identity gate allows screened list/search/show/suggestions reads and `machine` without `--label` in agent shells; graph and unscreened views are a person's, and so are changes: `promote`, `demote`, `forget`, `supersede`, `rebuild`, `machine --label` and the `goal` changes other than `link` stay person-only because the hub passes amem no agent actor, so amem records the user (#933). The upgrade path is agent-mem attribution (agent-mem#143), once the hub passes an agent actor. `ahub goal link` is also the configured conductor's: the hub records the peer as the link's actor. Managed peers use the bounded `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools through the daemon, with project scope, `memory_read`, PII-turn refusal and capture exclusion:
103
+ - **`ahub memory`** needs no running hub. An agent shell (an honest marker such as `CLAUDECODE`, `CODEX_THREAD_ID` or `AGENTHUB_PEER_ID`) runs the whole family except the person's few forms (#1522, owner decision 2026-11-16): `list`, `search`, `show`, `suggestions`, `machine` (`--label` included), `sync` (`--remote` included), `import`, `dedupe` (`--apply` included), `promote`, `demote`, `forget`, `supersede`, `rebuild`, `decay` and `declined`. The recording forms (`sync`, `import`, `dedupe`, `promote`, `demote`, `forget`, `supersede`, `rebuild`) run inside amem's agent attribution, so amem records and shows the agent (the peer id, `actor: agent`), never the person, and applies its screened-visibility check to every target; each still runs its own preview and confirm steps and policy screens. If amem's attribution cannot be reached, or no agent identity is found, the change is refused and nothing is written, never run as the person. `decay` and `declined` are read-only and show an agent only the generation prefix, never the home path, selector or skip totals. Still the person's: `graph` (its labels are unscreened note text), `confirm` and `reject` (judging a suggested link), `profile-check`, `--live-test` delegation of any memory write, and every command outside `memory`: hub verdicts and authority (approvals, task review verdicts, campaign verdicts, capabilities, `learn` accept and reject, conductor actions, queue retries) are not memory commands and keep their refusals. The marker is attribution, never person intent anywhere else. `ahub goal` keeps its own rule: `new`, `state`, `done` and `take` are the person's, and `ahub goal link` is the configured conductor's, the hub recording the peer as the link's actor. Managed peers use the bounded `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools through the daemon, with project scope, `memory_read`, PII-turn refusal and capture exclusion:
104
104
 
105
105
  ```bash
106
106
  ahub memory # this project's entries, newest first, with tier counts
@@ -171,7 +171,7 @@ A plan's explicit paths/symbols and refs paths are matched against live, screene
171
171
 
172
172
  ## Decay review
173
173
 
174
- `ahub memory decay [--days N] [--json]` is person-only, including in delegated live-test sessions. Default age is 90 days. It lists this project's long-term, live, non-superseded notes strictly older than the cutoff, excluding links to open/active/blocked goals through the note's task or `about` nodes. Reads use current privacy screening and defer automatic promotions; authoritative JSONL bytes do not change. Index maintenance remains derived-only. A person acts separately through existing `demote` or `forget`. These are review rows, with no candidate-sidecar write.
174
+ `ahub memory decay [--days N] [--json]` is a read-only review listing that an agent shell may run (#1522); `--live-test` still does not delegate it to the person. Default age is 90 days. It lists this project's long-term, live, non-superseded notes strictly older than the cutoff, excluding links to open/active/blocked goals through the note's task or `about` nodes. Reads use current privacy screening and defer automatic promotions; authoritative JSONL bytes do not change. Index maintenance remains derived-only. A person or an agent acts separately through existing `demote` or `forget`, recorded under that actor. These are review rows, with no candidate-sidecar write.
175
175
 
176
176
  ## Read-time staleness hint
177
177
 
@@ -212,7 +212,7 @@ Write screening examines both the JSON representation and literal structured key
212
212
 
213
213
  ## Agent-authored records (#1320)
214
214
 
215
- Managed headless Codex, Kimi, Qwen, Jcode, Pi and local turns receive the package-owned Record instruction once per owned turn. Claude sessions keep their own amem hook path; isolated reviewers and person-owned TUI prompts receive no new instruction. The public `recordsEnabled` accessor from exact-pinned amem 0.27.1 applies the effective machine/repository `records: false` setting to instruction, capture and Record preference. An unavailable policy disables this optional path.
215
+ Managed headless Codex, Kimi, Qwen, Jcode, Pi and local turns receive the package-owned Record instruction once per owned turn. Claude sessions keep their own amem hook path; isolated reviewers and person-owned TUI prompts receive no new instruction. The public `recordsEnabled` accessor from exact-pinned amem 0.28.0 applies the effective machine/repository `records: false` setting to instruction, capture and Record preference. An unavailable policy disables this optional path.
216
216
 
217
217
  The hub imports the instruction and parser from agent-mem. Valid final-answer records become `Record` capture rows with project and peer attribution, not curated notes or approved evidence. Complete text and anchors clear current secret, PII, private-path and deny policy before storage. Private, PII, review-scoped, remote, unbound and incomplete turns are excluded. Owner, turn, session, profile and policy must remain current; unsafe steering excludes the rest of that turn. No model or network call is added.
218
218
 
@@ -286,13 +286,13 @@ Sync uses the configured agent-mem standalone policy, narrowed by the hub's curr
286
286
 
287
287
  An unchanged failure emits one safe log line per episode. A complete bounded policy inspection identifies the declined ID set for failure dedupe without logging those IDs or their text. An incomplete or unavailable inspection keeps the set explicitly unknown rather than treating it as empty. Other failures use a private error hash; no raw error enters status or logs.
288
288
 
289
- `ahub memory declined [--json]` is a person-only, read-only inspection. It reports physical outbound row IDs and safe policy categories, never title, body, path nodes or literal private patterns. Reads defer promotions and recheck the profile binding. Forgotten originals still matter: `forget` changes materialized visibility but leaves the source row in append-only history. Do not use it as a promise to clear a sync refusal.
289
+ `ahub memory declined [--json]` is a read-only inspection that an agent shell may also run (#1522). It reports physical outbound row IDs and safe policy categories, never title, body, path nodes or literal private patterns. Reads defer promotions and recheck the profile binding. Forgotten originals still matter: `forget` changes materialized visibility but leaves the source row in append-only history. Do not use it as a promise to clear a sync refusal.
290
290
 
291
- The exact-pinned agent-mem 0.27.1 supplies bounded `inspectSyncPolicy` inspection for shared-v1 and generation profiles. A complete result lists the declined IDs and safe rule categories for the inspected physical outbound history, including originals hidden by a later forget. An incomplete `input-bound` result may now carry an optional `bound` receipt (`kind`, `limit`, `observed`, `nextStep`); `complete` and `reason` keep their shapes. An unavailable, stale or bounded-out inspection remains explicitly incomplete; it never proves that no declined rows exist. The hub uses the public SDK rather than private helpers, snapshots of full history or its own portable log reader.
291
+ The exact-pinned agent-mem 0.28.0 supplies bounded `inspectSyncPolicy` inspection for shared-v1 and generation profiles. A complete result lists the declined IDs and safe rule categories for the inspected physical outbound history, including originals hidden by a later forget. An incomplete `input-bound` result may now carry an optional `bound` receipt (`kind`, `limit`, `observed`, `nextStep`); `complete` and `reason` keep their shapes. An unavailable, stale or bounded-out inspection remains explicitly incomplete; it never proves that no declined rows exist. The hub uses the public SDK rather than private helpers, snapshots of full history or its own portable log reader.
292
292
 
293
293
  The package also owns per-row local placement. The hub adopts only the projection of a successful trusted SDK placement result: `ok` with its verified withheld/exported counts. Since agent-mem 0.23.0 the daemon passes `placementAttestation` on every `syncMemory` pass, built by the package's own `createPlacementAttestation` for the memory home (`hostPlacementAttestation`, `src/hub/memory-sync-attestation.ts`). A legacy or shared-v1 store ignores it. The hub supplies no writer facts of its own, never fabricates the proof and builds a new one per pass, so no measurement outlives it. A refusal (`PlacementWriterContextError`) is its own closed cause `writer` in status, the dashboard and the log: the category (`running CLI`, `host package`, `setup receipt`, `declared writer`, `active locator`, `home floor`, `writer renewal`, or `unknown` for an unrecognized SDK category), the cause class (`missing`, `changed`, `unavailable`) and the next step (repair the amem install and its host pin, then a person runs `amem migrate --sync-placement --dry-run`). The package's message, paths and versions never enter status or logs. It logs once per episode like every other cause. Count projection does not delete or rewrite notes, change policy or promote a declined row; transport failures remain failures.
294
294
 
295
- Legacy stores without active per-row placement still refuse a sync containing declined rows. The native amem CLI has person-only activation from 0.22.0 ([activation documentation](https://github.com/STAIxBWLB/agent-mem/blob/v0.24.0/README.md#initial-sync-placement-activation)). A person using a CLI upgraded with the hub's pin (0.27.1; a 0.22.1 install sharing the home drops Record entries, see [Agent-authored records](#agent-authored-records-1320)) can preview it with every local writer installation declared, including the CLI and hub library installs:
295
+ Legacy stores without active per-row placement still refuse a sync containing declined rows. The native amem CLI has person-only activation from 0.22.0 ([activation documentation](https://github.com/STAIxBWLB/agent-mem/blob/v0.24.0/README.md#initial-sync-placement-activation)). A person using a CLI upgraded with the hub's pin (0.28.0; a 0.22.1 install sharing the home drops Record entries, see [Agent-authored records](#agent-authored-records-1320)) can preview it with every local writer installation declared, including the CLI and hub library installs:
296
296
 
297
297
  ```sh
298
298
  amem migrate --sync-placement --dry-run --writer-root '<cli-install-root>' --writer-root '<host-amem-install-root>' --json
@@ -2068,12 +2068,12 @@ Task briefs, session-start recall and `ahub ask` read it first, and the dashboar
2068
2068
  ahub memory # this project's entries, newest first
2069
2069
  ahub memory search parser # every word must match
2070
2070
  ahub memory show 1a2b3c4d # one entry, its provenance and edges
2071
- ahub memory forget 1a2b3c4d # a person's; also promote, demote, supersede, rebuild
2071
+ ahub memory forget 1a2b3c4d # also promote, demote, supersede, rebuild; an agent shell's change is recorded as that agent (#1522)
2072
2072
  ```
2073
2073
 
2074
2074
  `"memory": { "native": false }` in `.agenthub/config.json` turns it off for a project.
2075
2075
 
2076
- The exact-pinned `@staix/agent-mem` 0.27.1 resolves `AMEM_HOME`, then `$AGENTHUB_HOME/memory`, then `~/.agenthub/memory`. An absent `M/profile.json` selects shared v1; an explicit generation selects `M/generations/G` with the package's readonly legacy bridge. All daemon memory consumers and the hub memory/goal CLI use that selected profile. Invalid metadata or a missing selected generation makes native memory unavailable while the bus and board continue; there is no fallback to legacy writes. Inspect the daemon's memory binding/availability before interpreting missing memory as an empty store.
2076
+ The exact-pinned `@staix/agent-mem` 0.28.0 resolves `AMEM_HOME`, then `$AGENTHUB_HOME/memory`, then `~/.agenthub/memory`. An absent `M/profile.json` selects shared v1; an explicit generation selects `M/generations/G` with the package's readonly legacy bridge. All daemon memory consumers and the hub memory/goal CLI use that selected profile. Invalid metadata or a missing selected generation makes native memory unavailable while the bus and board continue; there is no fallback to legacy writes. Inspect the daemon's memory binding/availability before interpreting missing memory as an empty store.
2077
2077
 
2078
2078
  The daemon checks its selector at hub operation entry and before candidate/counter writes. It does not hot-switch handles or provide an atomic fence against selection changes during an in-flight core call. Quiesce consumers and close their handles before migration or selection changes; reopen through the supported session-preserving lifecycle afterward. Candidate/counter storage remains `M/candidates.db`, independent of `G`; since agent-mem 0.7.0 `amem review` also lists and accepts candidates on a selected generation. Every running hub using this home needs an authenticated receipt: a matching ready binding, or a generation-capable unbound receipt (`disabled` when native memory is off, `unavailable` when opening failed) proving it holds no memory handle. An unbound daemon and zero running hubs are quiesced for memory; a stale bound handle, unreadable registry or unknown runtime is not ready. Existing JSON memory/goal results remain unchanged; the additive binding receipt belongs to daemon status, profile-check and the decay object. This source integration does not authorize installing a new runtime, migrating real memory, restarting sessions or claiming real-machine sync/capture receipts. Migration/deactivation and their limits belong to [agent-mem](https://github.com/STAIxBWLB/agent-mem); see [the hub profile contract](memory.md#selected-memory-profile).
2079
2079
 
@@ -6657,7 +6657,7 @@ Native launcher connections retry transport timeouts/unclean closes with bounded
6657
6657
 
6658
6658
  ## amem runtime (agent-mem#13 P4)
6659
6659
 
6660
- The hub exact-pins @staix/agent-mem <!-- facts:agent-mem-pin -->0.27.1<!-- /facts:agent-mem-pin --> for recall, curated evidence and local deterministic capture. No runtime call reaches a claude-mem worker; `memory.worker_url` is ignored. The person's `ahub memory import claude-mem` remains explicit and off by default. Existing profile, alias, PII and private-turn fences still apply. `ask --remember` and context checkpoints propose machine-local candidates, never automatic curated evidence. See [memory integration](memory.md#in-process-recall-and-capture-agent-mem13-p4) for changed behavior and bounded-view ceilings.
6660
+ The hub exact-pins @staix/agent-mem <!-- facts:agent-mem-pin -->0.28.0<!-- /facts:agent-mem-pin --> for recall, curated evidence and local deterministic capture. No runtime call reaches a claude-mem worker; `memory.worker_url` is ignored. The person's `ahub memory import claude-mem` remains explicit and off by default. Existing profile, alias, PII and private-turn fences still apply. `ask --remember` and context checkpoints propose machine-local candidates, never automatic curated evidence. See [memory integration](memory.md#in-process-recall-and-capture-agent-mem13-p4) for changed behavior and bounded-view ceilings.
6661
6661
 
6662
6662
  ## Person-run backlog legs (#1176)
6663
6663
 
@@ -7301,11 +7301,11 @@ Corrupt or unreadable provenance stays unknown and held. The status next step di
7301
7301
 
7302
7302
  A ready memory profile does not prove a successful sync. Read the separate automatic-sync result and timestamp in `ahub status` or Memory. It resets to not run after daemon restart; it is not a machine-global record of manual CLI attempts. Missing remote configuration (shared v1, generation and sharded homes alike) is the neutral `not-configured` state; an interrupted/stopped attempt is neutral `stopped`. Both keep their safe next step and produce no failure log under `quietSyncError`.
7303
7303
 
7304
- For policy-declined rows, a person runs `ahub memory declined --json` to inspect IDs and safe rule categories, never note text. The pinned agent-mem 0.27.1 public `inspectSyncPolicy` API bounds physical outbound inspection for shared-v1 and generation profiles. A complete result supplies the declined IDs and rules; `complete:false` means the scan is unavailable, stale or over its diagnostic bound, not zero declined rows. The command stays read-only and rechecks its profile binding. No migration or policy edit is performed automatically.
7304
+ For policy-declined rows, a person or an agent shell runs `ahub memory declined --json` to inspect IDs and safe rule categories, never note text. The pinned agent-mem 0.28.0 public `inspectSyncPolicy` API bounds physical outbound inspection for shared-v1 and generation profiles. A complete result supplies the declined IDs and rules; `complete:false` means the scan is unavailable, stale or over its diagnostic bound, not zero declined rows. The command stays read-only and rechecks its profile binding. No migration or policy edit is performed automatically.
7305
7305
 
7306
7306
  The hub projects verified withheld/exported counts when a trusted SDK sync returns a successful placement result. That projection is covered by an injected-result fixture, not an activated-store sync. Agent-mem requires a fresh `placementAttestation` even for an already active v3 store; since 0.35.0 the daemon builds one with the package's own `createPlacementAttestation` on every sync pass and supplies no writer facts of its own, so no attestation is fabricated. A refused attestation is the closed cause `writer` in status, the dashboard and the log: its category, its cause class (`missing`, `changed`, `unavailable`) and the next step (repair the amem install and its host pin, then a person runs `amem migrate --sync-placement --dry-run`). Activation remains a person-run action. A nonzero withheld count in a successful result is not a transport failure and does not mean those rows were deleted, rewritten or published. Inspect the IDs and rules before deliberately changing any source or approved policy; a forget operation does not remove its original text from physical history.
7307
7307
 
7308
- A legacy store without active per-row placement still blocks a sync containing declined rows. Status names inactive placement and the person-only `amem migrate --sync-placement --dry-run` preview, which requires every local writer installation through repeatable `--writer-root` flags. It keeps `ahub memory declined` as the safe inspection step. The native CLI supports activation from 0.22.0; the pinned core is 0.27.1. See the [activation preview and prerequisites](memory.md#automatic-sync-health-1173) before any separately authorized apply. Preview writes nothing, and activation does not migrate layouts, change policy or automatically raise a format floor. The hub does not invoke it or fabricate its proof.
7308
+ A legacy store without active per-row placement still blocks a sync containing declined rows. Status names inactive placement and the person-only `amem migrate --sync-placement --dry-run` preview, which requires every local writer installation through repeatable `--writer-root` flags. It keeps `ahub memory declined` as the safe inspection step. The native CLI supports activation from 0.22.0; the pinned core is 0.28.0. See the [activation preview and prerequisites](memory.md#automatic-sync-health-1173) before any separately authorized apply. Preview writes nothing, and activation does not migrate layouts, change policy or automatically raise a format floor. The hub does not invoke it or fabricate its proof.
7309
7309
 
7310
7310
  The bounded diagnostic addresses #1173 AC4; AC5 has result projection and the host attestation. Whether an activated store syncs on a person's machine is not established by the isolated fixtures.
7311
7311
 
@@ -18,7 +18,7 @@ Or use the matching GitHub release:
18
18
 
19
19
  <!-- facts:install-tag -->
20
20
  ```bash
21
- bun add -g github:STAIxBWLB/agent-hub#v0.41.0
21
+ bun add -g github:STAIxBWLB/agent-hub#v0.42.0
22
22
  ahub setup
23
23
  ```
24
24
  <!-- /facts:install-tag -->
@@ -50,6 +50,12 @@ terminal in that project: it reviews the plan with you, applies it and follows
50
50
  it; other projects keep their version. It then names the `bun add -g` and
51
51
  `ahub setup` step when your global CLI or plugin is older than the new daemon.
52
52
 
53
+ ## Upgrading to 0.42.0
54
+
55
+ Agent sessions (Claude, Codex and the other managed peers) can now run `ahub memory` changes themselves: `forget`, `promote`, `demote`, `supersede`, `rebuild`, `sync`, `import`, `dedupe`, `decay` and `declined`. amem records each change under the agent's peer id, not under you. `graph`, `confirm`, `reject` and `profile-check` stay yours. The memory library moves to agent-mem 0.28.0. Your memory home and sync format are unchanged, so a 0.41.0 hub can keep sharing it, and no floor is raised until you choose to.
56
+
57
+ `ahub upgrade` does not update the global CLI or the shared Claude plugin: run `bun add -g @staix/agent-hub@0.42.0` and then `ahub setup` yourself, and `ahub doctor` warns while either is older than a running daemon.
58
+
53
59
  ## Upgrading to 0.41.0
54
60
 
55
61
  Nothing changes until you use something new. The hub now pins agent-mem 0.27.1: `ahub memory search` groups hits from the same task (`--ungrouped` lists each one), the session preface orders long-term notes by observed use (`memory.preface_unused_after`, default 20, 0 keeps the store order), and `hub_checkpoint` accepts optional `done`, `in_progress`, `next`, `verified_by` and `traps` fields. GitHub milestone import stays the person's.
@@ -480,7 +486,7 @@ More: `ahub help`. How it is built and why: [`docs/specs/2026-09-19-agent-hub-de
480
486
 
481
487
  ## Shared memory
482
488
 
483
- The hub exact-pins the first-party `@staix/agent-mem` <!-- facts:agent-mem-pin -->0.27.1<!-- /facts:agent-mem-pin --> core, including deterministic capture; no claude-mem worker is needed. Existing shared-v1 memory remains the default; upgrading does not migrate it. Managed agents use screened `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools, or propose a correction with `hub_memory_correct`; only a person accepts candidates through the supported `amem review` path. Since agent-mem 0.7.0, `amem review` also accepts candidates on a selected generation.
489
+ The hub exact-pins the first-party `@staix/agent-mem` <!-- facts:agent-mem-pin -->0.28.0<!-- /facts:agent-mem-pin --> core, including deterministic capture; no claude-mem worker is needed. Existing shared-v1 memory remains the default; upgrading does not migrate it. Managed agents use screened `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` tools, or propose a correction with `hub_memory_correct`; only a person accepts candidates through the supported `amem review` path. Since agent-mem 0.7.0, `amem review` also accepts candidates on a selected generation.
484
490
 
485
491
  Before any real generation migration, upgrade every hub sharing that memory home to 0.12.30 or later and check its authenticated binding with `ahub memory profile-check` in each custom registry. Ready bindings prove compatibility, not an atomic live cutover: quiesce consumers and close their handles before migrating, then reopen through the supported session-preserving lifecycle. Invalid or changed profiles disable native memory without falling back to legacy writes; the bus and board continue. See [memory operations](operations.md#hub-memory) for the remaining rollout gates.
486
492
 
package/docs/security.md CHANGED
@@ -61,7 +61,7 @@ instead of changing the backend or copying dependency files.
61
61
 
62
62
  ## Native memory authority and profile selection
63
63
 
64
- The portable core is the exact-pinned first-party `@staix/agent-mem` 0.27.1 package; it does not replace the hub's caller identity, PII policy or task-write authority. Deny, hardened git, real paths and process identity are single-sourced in its Node-safe platform entry. Current project privacy is applied by the hub before promotion and again before model-facing reads. Standalone person reads are unscreened, and the standalone `--policy-free` acknowledgement grants no hub or peer authority.
64
+ The portable core is the exact-pinned first-party `@staix/agent-mem` 0.28.0 package; it does not replace the hub's caller identity, PII policy or task-write authority. Deny, hardened git, real paths and process identity are single-sourced in its Node-safe platform entry. Current project privacy is applied by the hub before promotion and again before model-facing reads. Standalone person reads are unscreened, and the standalone `--policy-free` acknowledgement grants no hub or peer authority.
65
65
 
66
66
  `hub_memory_search`, `hub_memory_show` and `hub_memory_graph` take the project from the daemon, require `memory_read`, refuse private turns and validate UTF-8 input before logs or storage work. Complete records and graph metadata are screened before counts and truncation. Search is at most 20 lines/4 KiB (default 8); show accepts at most 8 ids and returns at most 8 KiB; graph is at most 120 nodes/240 edges/6 KiB (default 60 nodes), with no edge lacking an endpoint. Unknown, ambiguous and withheld ids share one neutral refusal. Arguments and results are excluded from hub-managed capture; this does not govern a vendor's independent transcript or memory hooks.
67
67
 
@@ -876,8 +876,8 @@ narrowed by the hub's deny paths, PII patterns and project-private paths; a prom
876
876
  that fails it leaves the note short-term (#1173). Status exposes safe sync state and
877
877
  counts, including verified withheld/exported counts from a successful SDK placement
878
878
  result. Failure logs retain only the closed cause and known declined count.
879
- `ahub memory declined` is person-only (refused to agent shells and `--live-test`)
880
- and uses bounded physical-row inspection to show IDs and rule categories, never
879
+ `ahub memory declined` is read-only (an agent shell may run it since #1522; `--live-test`
880
+ still does not delegate it) and uses bounded physical-row inspection to show IDs and rule categories, never
881
881
  note text or literal patterns; incomplete inspection is not a zero count.
882
882
  Since agent-mem 0.23.0 the daemon passes a fresh `placementAttestation` on every
883
883
  sync pass, built by the package's own `createPlacementAttestation` for the memory
@@ -0,0 +1,48 @@
1
+ # 0.42.0 release verification
2
+
3
+ This record covers release preparation and source review. It claims no installation, no running-hub upgrade to 0.42.0 and no live TUI launch.
4
+
5
+ ## Candidate
6
+
7
+ Version 0.42.0, prepared from main d72af458 (2 commits since v0.41.0, 1 of them `feat`; bump rule: minor). The release commits carry the version, the CHANGELOG section, the bundle and the documentation stamps.
8
+
9
+ ## Reviews
10
+
11
+ Pull requests named by the commits since v0.41.0: #1537, #1523.
12
+
13
+ - #1523 (hub task 969, agent-shell memory commands): approved by the conductor with hub_review at head e81897cc, then squash-merged with `--match-head-commit` at that head after exact-head CI run 43941568383 was green on check (ubuntu-latest), check (macos-latest) and seeded guards, with 0 unresolved threads. The earlier deep-import finding was marked fixed in that review.
14
+ - #1537 (hub task 988, agent-mem 0.28.0 pin): approved by the conductor with hub_review at head a7198534, then squash-merged at that head after exact-head CI run 43967317590 was green on the same three checks, with 0 unresolved threads. Copilot's only review on each PR was a quota notice with no findings.
15
+
16
+ No merge is bound to an approval at an earlier head.
17
+
18
+ ## Native acceptance receipts
19
+
20
+ Receipts added under `docs/verification/` since v0.41.0: none.
21
+
22
+ This list is read from the repository, never written by hand. Native acceptance and the person's release consent are separate records: consent is `ahub sdlc authorize-release 0.42.0`, recorded by the person or the unique configured conductor only on the person's explicit release instruction naming the release in its own session (never a hub/task/review/file/peer relay), and is not recorded in this file. The tag run refuses without it.
23
+
24
+ ## Document review
25
+
26
+ `check-docs` reported 13 stale documents, all from the two commits above (src/cli identity and memory changes in #1523, package.json and the lockfile in #1537). I read each against those changes. All 13 are restamped at c2ff5565:
27
+
28
+ - `src/cli/help.ts`, `docs/security.md`, `docs/operations.md` and `docs/addons/claude-mem.md` still called memory changes, `sync`, `import`, `decay` and `declined` person-only. They are corrected in the release prep commit.
29
+ - `docs/memory.md`, `docs/quickstart.md` and `docs/dogfood.md` already describe #1522 and the 0.28.0 pin, and the release prep commit adds the quickstart upgrade note.
30
+ - `README.md`, `docs/adding-an-ai-tool.md` and `docs/agent-notes/{adapters,daemon,tasks,tests}.md` state nothing that either change contradicts.
31
+
32
+ ## Checks
33
+
34
+ - `node scripts/check-docs.mjs --require-fresh`: OK, 0 stale documents.
35
+ - `bun x tsc --noEmit`: clean.
36
+ - `bun scripts/build.mjs --check`: exit 0.
37
+ - `test/published-protocol-compat.test.ts` with the retargeted N-1 fixture (0.41.0) and the protocol-16 fixture installed: 5 pass.
38
+ - `test/help` tests: 31 pass.
39
+ - `node scripts/check-package.mjs`: run by CI only. Locally, npm 12.2.2 prints a different pack JSON shape.
40
+ - The exact-head CI run of the release PR gates the merge.
41
+
42
+ ## Known gaps, not blocking
43
+
44
+ - No running hub was upgraded to 0.42.0. The hub on this machine is still 0.39.0.
45
+ - No live TUI launch or real-model turn was made.
46
+ - The full local suite was not run on this Mac; heavy tests go to CI.
47
+ - Agent-attributed memory writes in a real agent shell (outside fixtures) are unverified.
48
+ - A shared memory home between a 0.41.0 hub and a 0.42.0 hub is reasoned from agent-mem 0.28.0 raising no format floor, not measured.
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "documents": {
4
4
  "README.md": {
5
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
5
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
6
6
  "paths": [
7
7
  "package.json",
8
8
  "src/",
@@ -11,14 +11,14 @@
11
11
  ]
12
12
  },
13
13
  "docs/security.md": {
14
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
14
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
15
15
  "paths": [
16
16
  "src/",
17
17
  "templates/"
18
18
  ]
19
19
  },
20
20
  "docs/operations.md": {
21
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
21
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
22
22
  "paths": [
23
23
  "package.json",
24
24
  "src/",
@@ -35,7 +35,7 @@
35
35
  ]
36
36
  },
37
37
  "docs/quickstart.md": {
38
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
38
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
39
39
  "paths": [
40
40
  "package.json",
41
41
  "src/",
@@ -43,7 +43,7 @@
43
43
  ]
44
44
  },
45
45
  "docs/adding-an-ai-tool.md": {
46
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
46
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
47
47
  "paths": [
48
48
  "src/adapters/registry-types.ts",
49
49
  "src/adapters/registry.ts",
@@ -62,7 +62,7 @@
62
62
  ]
63
63
  },
64
64
  "docs/addons/claude-mem.md": {
65
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
65
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
66
66
  "paths": [
67
67
  "src/hub/tooling.ts",
68
68
  "src/adapters/definitions/native-policy-aux.ts",
@@ -154,7 +154,7 @@
154
154
  ]
155
155
  },
156
156
  "docs/dogfood.md": {
157
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
157
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
158
158
  "paths": [
159
159
  "src/hub/dogfood.ts",
160
160
  "src/hub/dogfood-read.ts",
@@ -177,7 +177,7 @@
177
177
  ]
178
178
  },
179
179
  "docs/memory.md": {
180
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
180
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
181
181
  "paths": [
182
182
  "package.json",
183
183
  "src/memory/",
@@ -273,7 +273,7 @@
273
273
  ]
274
274
  },
275
275
  "docs/agent-notes/adapters.md": {
276
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
276
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
277
277
  "paths": [
278
278
  "src/adapters/",
279
279
  "src/pi/",
@@ -362,7 +362,7 @@
362
362
  ]
363
363
  },
364
364
  "docs/agent-notes/daemon.md": {
365
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
365
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
366
366
  "paths": [
367
367
  "src/hub/daemon.ts",
368
368
  "src/hub/control-client.ts",
@@ -473,7 +473,7 @@
473
473
  ]
474
474
  },
475
475
  "docs/agent-notes/tasks.md": {
476
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
476
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
477
477
  "paths": [
478
478
  "src/hub/tasks.ts",
479
479
  "src/hub/board.ts",
@@ -521,7 +521,7 @@
521
521
  ]
522
522
  },
523
523
  "docs/agent-notes/tests.md": {
524
- "verifiedAgainst": "c2a1f646720b2d79990d80cf07faefc3de3f8c86",
524
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
525
525
  "paths": [
526
526
  "test/",
527
527
  "scripts/check.sh",
@@ -559,7 +559,7 @@
559
559
  ]
560
560
  },
561
561
  "src/cli/help.ts": {
562
- "verifiedAgainst": "1485f322ca22fc2700110d71d7109992a3c276df",
562
+ "verifiedAgainst": "c2ff556563d8ef092b68e278ad7897249d973063",
563
563
  "paths": [
564
564
  "src/cli/main.ts",
565
565
  "src/cli/launch.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staix/agent-hub",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "Native multi-agent hub: Claude Code, Codex, Kimi Code, Pi and local inference as peers in one project",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,7 +17,7 @@
17
17
  "bun": ">=1.4.4"
18
18
  },
19
19
  "dependencies": {
20
- "@staix/agent-mem": "0.27.1"
20
+ "@staix/agent-mem": "0.28.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@modelcontextprotocol/sdk": "^1.27.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-hub",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "Channel between Claude Code and the agent-hub daemon: peer messages from Codex, Kimi and the local worker arrive as channel events; hub_send replies.",
5
5
  "author": {
6
6
  "name": "Young Joon Lee",
@@ -13519,7 +13519,7 @@ var package_default;
13519
13519
  var init_package = __esm(() => {
13520
13520
  package_default = {
13521
13521
  name: "@staix/agent-hub",
13522
- version: "0.41.0",
13522
+ version: "0.42.0",
13523
13523
  description: "Native multi-agent hub: Claude Code, Codex, Kimi Code, Pi and local inference as peers in one project",
13524
13524
  license: "MIT",
13525
13525
  type: "module",
@@ -13536,7 +13536,7 @@ var init_package = __esm(() => {
13536
13536
  bun: ">=1.4.4"
13537
13537
  },
13538
13538
  dependencies: {
13539
- "@staix/agent-mem": "0.27.1"
13539
+ "@staix/agent-mem": "0.28.0"
13540
13540
  },
13541
13541
  devDependencies: {
13542
13542
  "@modelcontextprotocol/sdk": "^1.27.1",
@@ -14448,6 +14448,11 @@ var init_note_add = __esm(() => {
14448
14448
  init_cli_attribution();
14449
14449
  });
14450
14450
 
14451
+ // node_modules/@staix/agent-mem/src/memory/candidate-origin.ts
14452
+ var init_candidate_origin = __esm(() => {
14453
+ init_screen();
14454
+ });
14455
+
14451
14456
  // node_modules/@staix/agent-mem/src/memory/candidates.ts
14452
14457
  var CANDIDATE_RETENTION, COUNTER_RETENTION;
14453
14458
  var init_candidates = __esm(() => {
@@ -14458,6 +14463,7 @@ var init_candidates = __esm(() => {
14458
14463
  init_home();
14459
14464
  init_platform();
14460
14465
  init_private_spans();
14466
+ init_candidate_origin();
14461
14467
  CANDIDATE_RETENTION = { count: 500, ageMs: 30 * 86400000 };
14462
14468
  COUNTER_RETENTION = { count: 1e4, ageMs: 90 * 86400000 };
14463
14469
  });
@@ -14709,6 +14715,7 @@ var init_mcp_memory = __esm(() => {
14709
14715
  init_repo_scope();
14710
14716
  init_store();
14711
14717
  init_vault();
14718
+ init_candidate_origin();
14712
14719
  init_work_lists();
14713
14720
  });
14714
14721
 
@@ -14913,6 +14920,7 @@ var init_goal_promotion = __esm(() => {
14913
14920
  var init_consolidation_model = __esm(() => {
14914
14921
  init_candidates();
14915
14922
  init_policy();
14923
+ init_candidate_origin();
14916
14924
  init_platform();
14917
14925
  });
14918
14926
 
@@ -14929,6 +14937,7 @@ var init_consolidate = __esm(() => {
14929
14937
  init_consolidation_clusters();
14930
14938
  init_policy();
14931
14939
  init_platform();
14940
+ init_candidate_origin();
14932
14941
  init_consolidation_model();
14933
14942
  init_record_candidates();
14934
14943
  });
@@ -15035,6 +15044,14 @@ var init_sync_placement_writer_history = __esm(() => {
15035
15044
  init_sync_placement_writer_revision_format();
15036
15045
  });
15037
15046
 
15047
+ // node_modules/@staix/agent-mem/src/memory/sync-placement-batch-intent.ts
15048
+ var PLACEMENT_BATCH_INTENT_MAX_BYTES;
15049
+ var init_sync_placement_batch_intent = __esm(() => {
15050
+ init_generation();
15051
+ init_sync_placement_journal_format();
15052
+ PLACEMENT_BATCH_INTENT_MAX_BYTES = 20 * 1024 * 1024;
15053
+ });
15054
+
15038
15055
  // node_modules/@staix/agent-mem/src/memory/sync-placement-journal-storage.ts
15039
15056
  var inflight, publicationDurability;
15040
15057
  var init_sync_placement_journal_storage = __esm(() => {
@@ -15048,6 +15065,8 @@ var init_sync_placement_journal_storage = __esm(() => {
15048
15065
  init_sync_placement_projection();
15049
15066
  init_sync_placement_writer_revision_format();
15050
15067
  init_sync_placement_writer_history();
15068
+ init_sync_placement_batch_intent();
15069
+ init_formats();
15051
15070
  inflight = new WeakSet;
15052
15071
  publicationDurability = new WeakMap;
15053
15072
  });
@@ -13501,7 +13501,7 @@ var package_default;
13501
13501
  var init_package = __esm(() => {
13502
13502
  package_default = {
13503
13503
  name: "@staix/agent-hub",
13504
- version: "0.41.0",
13504
+ version: "0.42.0",
13505
13505
  description: "Native multi-agent hub: Claude Code, Codex, Kimi Code, Pi and local inference as peers in one project",
13506
13506
  license: "MIT",
13507
13507
  type: "module",
@@ -13518,7 +13518,7 @@ var init_package = __esm(() => {
13518
13518
  bun: ">=1.4.4"
13519
13519
  },
13520
13520
  dependencies: {
13521
- "@staix/agent-mem": "0.27.1"
13521
+ "@staix/agent-mem": "0.28.0"
13522
13522
  },
13523
13523
  devDependencies: {
13524
13524
  "@modelcontextprotocol/sdk": "^1.27.1",
@@ -14430,6 +14430,11 @@ var init_note_add = __esm(() => {
14430
14430
  init_cli_attribution();
14431
14431
  });
14432
14432
 
14433
+ // node_modules/@staix/agent-mem/src/memory/candidate-origin.ts
14434
+ var init_candidate_origin = __esm(() => {
14435
+ init_screen();
14436
+ });
14437
+
14433
14438
  // node_modules/@staix/agent-mem/src/memory/candidates.ts
14434
14439
  var CANDIDATE_RETENTION, COUNTER_RETENTION;
14435
14440
  var init_candidates = __esm(() => {
@@ -14440,6 +14445,7 @@ var init_candidates = __esm(() => {
14440
14445
  init_home();
14441
14446
  init_platform();
14442
14447
  init_private_spans();
14448
+ init_candidate_origin();
14443
14449
  CANDIDATE_RETENTION = { count: 500, ageMs: 30 * 86400000 };
14444
14450
  COUNTER_RETENTION = { count: 1e4, ageMs: 90 * 86400000 };
14445
14451
  });
@@ -14691,6 +14697,7 @@ var init_mcp_memory = __esm(() => {
14691
14697
  init_repo_scope();
14692
14698
  init_store();
14693
14699
  init_vault();
14700
+ init_candidate_origin();
14694
14701
  init_work_lists();
14695
14702
  });
14696
14703
 
@@ -14895,6 +14902,7 @@ var init_goal_promotion = __esm(() => {
14895
14902
  var init_consolidation_model = __esm(() => {
14896
14903
  init_candidates();
14897
14904
  init_policy();
14905
+ init_candidate_origin();
14898
14906
  init_platform();
14899
14907
  });
14900
14908
 
@@ -14911,6 +14919,7 @@ var init_consolidate = __esm(() => {
14911
14919
  init_consolidation_clusters();
14912
14920
  init_policy();
14913
14921
  init_platform();
14922
+ init_candidate_origin();
14914
14923
  init_consolidation_model();
14915
14924
  init_record_candidates();
14916
14925
  });
@@ -15017,6 +15026,14 @@ var init_sync_placement_writer_history = __esm(() => {
15017
15026
  init_sync_placement_writer_revision_format();
15018
15027
  });
15019
15028
 
15029
+ // node_modules/@staix/agent-mem/src/memory/sync-placement-batch-intent.ts
15030
+ var PLACEMENT_BATCH_INTENT_MAX_BYTES;
15031
+ var init_sync_placement_batch_intent = __esm(() => {
15032
+ init_generation();
15033
+ init_sync_placement_journal_format();
15034
+ PLACEMENT_BATCH_INTENT_MAX_BYTES = 20 * 1024 * 1024;
15035
+ });
15036
+
15020
15037
  // node_modules/@staix/agent-mem/src/memory/sync-placement-journal-storage.ts
15021
15038
  var inflight, publicationDurability;
15022
15039
  var init_sync_placement_journal_storage = __esm(() => {
@@ -15030,6 +15047,8 @@ var init_sync_placement_journal_storage = __esm(() => {
15030
15047
  init_sync_placement_projection();
15031
15048
  init_sync_placement_writer_revision_format();
15032
15049
  init_sync_placement_writer_history();
15050
+ init_sync_placement_batch_intent();
15051
+ init_formats();
15033
15052
  inflight = new WeakSet;
15034
15053
  publicationDurability = new WeakMap;
15035
15054
  });
@@ -0,0 +1,6 @@
1
+ import { configuredPolicy, memoryHome, withCliAttribution } from "@staix/agent-mem";
2
+
3
+ /** Run an agent's memory commands in the public amem attribution and visibility scope. */
4
+ export async function withAgentAttribution<T>(peer: string, cwd: string, work: () => Promise<T>): Promise<T> {
5
+ return withCliAttribution({ actor: "agent", peer, policy: () => configuredPolicy(memoryHome(), cwd) }, work);
6
+ }
package/src/cli/help.ts CHANGED
@@ -198,11 +198,11 @@ const SECTIONS: [string, [usage: string, description: string][]][] = [
198
198
  ["ahub check-path <file> [--peer <id>]", "other owners' open tasks that claim or changed a file"],
199
199
  ["ahub memory [list] [--tier short|long] [--kind <kind>] [--peer <p>] [--machine <id>] [--since <iso>] [--limit N] [--json]", "the hub's own memory for this project: decisions, contracts, fails and findings, short- and long-term (docs/memory.md)"],
200
200
  ["ahub memory search <words> [--ungrouped] | show <id> | graph <id|node> [--hops 1|2] [--history | --as-of <iso>] [--json]", "find entries, read one with its provenance, or list its graph neighbourhood; search groups visible hits by task unless --ungrouped; superseded and expired entries are hidden unless a person asks for --history or --as-of"],
201
- ["ahub memory promote|demote|forget <id> | supersede <old> <new> | rebuild", "a person's changes to memory: move an entry between tiers, forget it, mark it superseded, or rebuild the index from the logs"],
202
- ["ahub memory sync [--remote <private git url>] | machine [--label <name>]", "sync hub memory with your other machines through a private git remote (a person's), or show or name this machine"],
203
- ["ahub memory import claude-mem [--db <path>] [--limit N] [--restart] | dedupe [--apply] | suggestions | confirm|reject <id>", "copy the hub's notes from claude-mem into hub memory (a person's); review the model's suggested edges"],
204
- ["ahub memory decay [--days N] [--json]", "person only: list long-term entries older than N days (default 90) that no open goal links; review only, nothing is changed"],
205
- ["ahub memory declined [--json]", "person only: list declined physical outbound row ids and safe rule labels; never shows row text; reports incomplete scans explicitly"],
201
+ ["ahub memory promote|demote|forget <id> | supersede <old> <new> | rebuild", "change memory: move an entry between tiers, forget it, mark it superseded, or rebuild the index from the logs; an agent shell's change is recorded as that agent"],
202
+ ["ahub memory sync [--remote <private git url>] | machine [--label <name>]", "sync hub memory with your other machines through a private git remote, or show or name this machine"],
203
+ ["ahub memory import claude-mem [--db <path>] [--limit N] [--restart] | dedupe [--apply] | suggestions | confirm|reject <id>", "copy the hub's notes from claude-mem into hub memory; review the model's suggested edges (confirm and reject are a person's)"],
204
+ ["ahub memory decay [--days N] [--json]", "list long-term entries older than N days (default 90) that no open goal links; review only, nothing is changed"],
205
+ ["ahub memory declined [--json]", "list declined physical outbound row ids and safe rule labels; never shows row text; reports incomplete scans explicitly"],
206
206
  ["ahub memory profile-check [--json]", "read-only check of the running hubs' memory bindings against their memory profiles; exits 1 when one is not ready"],
207
207
  ["ahub goal [list] [--all] | show <id> [--json]", "long-term tasks: state, which machine holds each and until when, linked board tasks"],
208
208
  ["ahub goal new <title> [--milestone <text>]... [--depends <id>]... [--shared] | link <id> <task> | state <id> <state> | done <id> | take <id> [--force]", "a person's changes to long-term tasks (link also the configured conductor's); take --force voids other machines' claims"],
@@ -78,6 +78,11 @@ export function detectCliIdentity(env: Readonly<Record<string, string | undefine
78
78
 
79
79
  export type PeerCommandAccess = "allowed" | "conductor" | "console";
80
80
 
81
+ /** #1522: the `ahub memory` subcommands an agent shell runs (reads, and the changes amem records under the agent's own name). Anything else in the family stays the person's. */
82
+ export const AGENT_MEMORY_SUBS: readonly string[] = ["list", "search", "show", "suggestions", "machine", "sync", "import", "dedupe", "promote", "demote", "forget", "supersede", "rebuild", "decay", "declined"];
83
+ /** The ones that change memory and record an actor: `memoryCommand` runs these under the agent's attribution. Reads and the two review previews run unchanged. */
84
+ export const AGENT_MEMORY_RECORDING_SUBS: readonly string[] = ["sync", "import", "dedupe", "promote", "demote", "forget", "supersede", "rebuild"];
85
+
81
86
  /** Flags the read-only forms of #812 accept: display options that change no behaviour. */
82
87
  const peerReadFlags = (args: readonly string[]): boolean =>
83
88
  args.every((arg) => ["--json", "--full", "--verbose", "--color=always", "--color=never", "--color=auto"].includes(arg) || arg.startsWith("--color="));
@@ -192,8 +197,9 @@ export function classifyPeerCommand(command: string, args: readonly string[], ca
192
197
  if (command === "agents") return args.every(arg => arg === "--json") ? "allowed" : "console";
193
198
  // #247: reading the research measures and records is harmless (ids and counts only); #933 made backfill a conductor operation (above).
194
199
  if (command === "research") return args[0] === "backfill" ? "console" : "allowed";
195
- // #258: reading hub memory is harmless; promote, demote, forget, supersede, rebuild and goal changes stay a person's (#933: amem records their actor as "user"; goal link is a conductor operation, above).
196
- if (command === "memory") { const sub = args.find((arg) => arg !== "--json"); return sub === undefined || sub.startsWith("--") || ["list", "search", "show", "suggestions"].includes(sub) || (sub === "machine" && !args.includes("--label")) ? "allowed" : "console"; } // graph labels are unscreened note text: a person's
200
+ // #1522 (hub task 969): an agent shell runs the memory family as itself. The CLI wraps the writers in amem's agent attribution (`memoryCommand`), so the recorded and displayed actor is the agent, never the person.
201
+ // Left to the person: `graph` (its labels are unscreened note text), `confirm`/`reject` (judgments of suggested links), `profile-check` and every command outside `memory`; hub verdicts are not memory commands.
202
+ if (command === "memory") { const sub = args.find((arg) => arg !== "--json"); return sub === undefined || sub.startsWith("--") || AGENT_MEMORY_SUBS.includes(sub) ? "allowed" : "console"; }
197
203
  if (command === "goal") { const sub = args.find((arg) => arg !== "--json"); return sub === undefined || sub.startsWith("--") || ["list", "show"].includes(sub) ? "allowed" : "console"; }
198
204
  // #251: a run resets the bench project's tree and proposes work (#933: a conductor operation, above); reading results is harmless.
199
205
  // The subcommand is the first argument that is not --json, which the command accepts anywhere.
package/src/cli/main.ts CHANGED
@@ -2857,7 +2857,8 @@ const commands: Record<string, () => Promise<void> | void> = {
2857
2857
  if (!result.ready) process.exitCode = 1;
2858
2858
  return;
2859
2859
  }
2860
- try { console.log(await memoryCommand(args, cwd, { person: caller.role === "console" })); } catch (e) { fail((e as Error).message); }
2860
+ // #1522: an agent shell runs this as itself; its peer id, not the person, is what amem records for a change.
2861
+ try { console.log(await memoryCommand(args, cwd, { person: caller.role === "console", ...(caller.role === "tools" ? { agent: caller.peer } : {}) })); } catch (e) { fail((e as Error).message); }
2861
2862
  },
2862
2863
  goal: async () => {
2863
2864
  // #258: long-term tasks; a link goes through the project's hub, so Tasks validates the board task.
package/src/cli/memory.ts CHANGED
@@ -12,7 +12,8 @@ import { foldSegment } from "../hub/permission-mode.ts";
12
12
  import { matchesPolicyLexically } from "../hub/path-policy.ts";
13
13
  import { memoryAnchorTaskIdentity, memoryStaleAnchors, unavailableMemoryStaleAnchors, type MemoryStaleAnchorReport, type MemoryTaskPrivacy } from "../hub/memory-stale-anchors.ts";
14
14
  import { MEMORY_SYMBOL_START_BUDGET_MS } from "../hub/memory-symbols.ts";
15
- import { detectCliIdentity } from "./identity.ts";
15
+ import { AGENT_MEMORY_RECORDING_SUBS, detectCliIdentity } from "./identity.ts";
16
+ import { withAgentAttribution } from "./agent-attribution.ts";
16
17
  import { createStalenessProbe } from "../hub/memory-staleness.ts";
17
18
  import { looksSecret, memoryHome, memoryProjectKey, pathCandidates, readProfileJSON, resolveShardProfile, type MemoryStore } from "@staix/agent-mem";
18
19
  import type { SyncOptions } from "@staix/agent-mem";
@@ -111,6 +112,9 @@ function commandStores(provided: MemoryStore | undefined, options: ProfileMemory
111
112
  try { return { ...(provided ? bindProfileMemory(provided, undefined, memoryProjectKey(cwd)) : openProfileMemory(options)), owned: !provided }; }
112
113
  catch (error) { throw new Error(error instanceof Error && error.message === MEMORY_SPLIT_INCOMPLETE ? error.message : MEMORY_PROFILE_UNAVAILABLE); }
113
114
  }
115
+ /** What a JSON receipt may carry for an agent (#1522): the kind, state and generation prefix, never the home path, selector, version or skip totals the person sees. */
116
+ const shownReceipt = (profile: MemoryProfileReceipt | undefined, person: boolean) =>
117
+ person || !profile ? profile : { profile: profile.profile, state: profile.state, ...(profile.generation ? { generation: profile.generation.slice(0, 8) } : {}) };
114
118
  function profileOutput(text: string, json: boolean, profile: MemoryProfileReceipt | undefined, person: boolean): string {
115
119
  if (!profile) return text;
116
120
  if (profile.state !== "ready") throw new Error(MEMORY_PROFILE_UNAVAILABLE);
@@ -119,12 +123,23 @@ function profileOutput(text: string, json: boolean, profile: MemoryProfileReceip
119
123
  }
120
124
 
121
125
  /** Hub wrapper: current project policy and TTL stay here; parsing and storage commands belong to the core. */
122
- export async function memoryCommand(args: string[], cwd: string, opts: { store?: MemoryStore; sync?: Omit<SyncOptions, "remote">; now?: () => number; person?: boolean } = {}): Promise<string> {
126
+ export async function memoryCommand(args: string[], cwd: string, opts: { store?: MemoryStore; sync?: Omit<SyncOptions, "remote">; now?: () => number; person?: boolean; /** The agent shell's peer id (#1522): its changes are recorded under this name. */ agent?: string } = {}): Promise<string> {
123
127
  const person = opts.person ?? detectCliIdentity(process.env).role === "console";
128
+ const sub = args.find(arg => arg !== "--json");
129
+ // #1522: an agent runs the family as itself. The recording commands run inside amem's agent attribution, so every writer stamps the agent (never "user")
130
+ // and amem applies its screened-visibility checks to each target; with no agent peer id, or no way to attribute, a change is refused rather than run as the person.
131
+ if (!person && sub !== undefined && AGENT_MEMORY_RECORDING_SUBS.includes(sub)) {
132
+ const peer = opts.agent ?? (() => { const identity = detectCliIdentity(process.env); return identity.role === "tools" ? identity.peer : undefined; })();
133
+ if (peer === undefined) fail(`memory ${sub} changes memory and needs an identified agent or the person; no agent identity was found, so nothing was run`);
134
+ return withAgentAttribution(peer!, cwd, () => memoryCommandBody(args, cwd, opts, person));
135
+ }
136
+ return memoryCommandBody(args, cwd, opts, person);
137
+ }
138
+
139
+ async function memoryCommandBody(args: string[], cwd: string, opts: { store?: MemoryStore; sync?: Omit<SyncOptions, "remote">; now?: () => number }, person: boolean): Promise<string> {
124
140
  const privatePaths = (): string[] => { try { return loadConfig(cwd).pii?.paths ?? []; } catch (e) { return fail(`the project's config does not load (${(e as Error).message}); fix it before reading hub memory`); } };
125
141
  const rest = args.filter(arg => arg !== "--json");
126
142
  if (rest[0] === "decay") {
127
- if (!person) fail("memory decay requires person authority");
128
143
  let days = 90;
129
144
  if (rest.length !== 1) {
130
145
  if (rest.length !== 3 || rest[1] !== "--days" || !/^[1-9][0-9]*$/.test(rest[2]!)) fail("usage: ahub memory decay [--days N] [--json] (N must be a positive integer)");
@@ -149,7 +164,8 @@ export async function memoryCommand(args: string[], cwd: string, opts: { store?:
149
164
  && !note.about.some(node => openGoals.has(node) || (node.startsWith("task:") && linkedTasks.has(node.slice(5))))), routing, cwd, paths);
150
165
  });
151
166
  const profile = context.binding.status(store);
152
- if (args.includes("--json")) return profileOutput(JSON.stringify({ days, cutoff, candidates, memoryProfile: profile }), true, profile, person);
167
+ // #1522: decay is open to an agent, so its JSON carries only the receipt an agent may see.
168
+ if (args.includes("--json")) return profileOutput(JSON.stringify({ days, cutoff, candidates, memoryProfile: shownReceipt(profile, person) }), true, profile, person);
153
169
  const text = candidates.length
154
170
  ? [`${candidates.length} decay candidate${candidates.length === 1 ? "" : "s"} older than ${days} days (review only):`, ...candidates.map(note => `mem:${note.id} ${note.at} ${note.kind}: ${note.title ?? note.text}`)].join("\n")
155
171
  : `no decay candidates older than ${days} days`;
@@ -157,7 +173,6 @@ export async function memoryCommand(args: string[], cwd: string, opts: { store?:
157
173
  } finally { if (context.owned) store.close(); }
158
174
  }
159
175
  if (rest[0] === "declined") {
160
- if (!person) fail("memory declined requires person authority");
161
176
  if (rest.length !== 1) fail("usage: ahub memory declined [--json]");
162
177
  const project = projectOf(cwd, opts.store);
163
178
  const context = commandStores(opts.store, { project, deferPromotions: true, now: opts.now }, cwd);
@@ -175,7 +190,7 @@ export async function memoryCommand(args: string[], cwd: string, opts: { store?:
175
190
  const profile = context.binding.status(context.store);
176
191
  if (hostSyncPolicyInputs(cwd, context.binding.home, project, profile).version !== boundPolicy.version)
177
192
  fail("memory declined policy changed during inspection; retry with stable privacy policy");
178
- if (args.includes("--json")) return JSON.stringify({ rows: result.rows, complete: result.complete, ...(result.reason ? { reason: result.reason } : {}), memoryProfile: profile });
193
+ if (args.includes("--json")) return JSON.stringify({ rows: result.rows, complete: result.complete, ...(result.reason ? { reason: result.reason } : {}), memoryProfile: shownReceipt(profile, person) });
179
194
  const text = result.complete
180
195
  ? result.rows.length
181
196
  ? [`${result.rows.length} declined physical outbound row${result.rows.length === 1 ? "" : "s"}:`, ...result.rows.map(row => `mem:${row.id} ${row.rule}`), "Review the source or approved policy, then run `ahub memory sync`. `forget` does not remove append-only physical rows."].join("\n")