Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
Merge PR #1053: feat(eval): record structured checker results
AkitaOnRailsd18cdbd5e5c3
diff --cc CHANGELOG.mdindex eeeadc6b,2eedafc7..b1619079--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -119,25 -121,8 +119,30 @@@ and this project adheres to [Semantic Vor distinct extensions, including backfill).Mixed-source counts preserve scope, session ownership and time-window filters;older servers leave unsupported fields unknown. (#1016)+- Added Portuguese history phrases to the existing opt-in session-recall+ router (`[retrieval] query_intent`), including accented and unaccented spellings of+ "última sessão", "onde paramos ontem", and "decisão anterior". Word+ boundaries and explicit history phrases keep technical session queries+ unchanged; routing remains off by default. (#1056)+- Added shared, typed and bounded `entities`, `abstract`, and `relations`+ metadata to MCP `memory_write_page` and admin `/admin/write-page`, plus bounded+ MCP `kind` while preserving the admin's legacy `kind` adapter. Kept existing+ request shapes, entity normalization, authenticated attribution and the wiki+ write pipeline. Documented whole-page replacement, raw-input metadata bounds+ and trimmed relation scope components. (#1055)++- Added structured results for the existing auto-improvement eval execution in++ review reports, staged run metadata, and accepted proposal sidecars, with++ server-generated eval IDs, evaluated request/body digests, checker invocation++ identity, observed success/rejection/failure/timeout, and sanitized bounded++ reasons. Report deserialization discarded supplied eval observations. (#1053)### Changed+- Restricted managed-workstream provenance to scrubbed source labels and an+ explicit scalar metadata allowlist, with 512-byte string bounds. Client event+ ids beginning with `managed-run:` are reserved for server checkpoints and+ extraction-loss annotations. Active-run retries reject changes to an existing+ event's agent, native session or kind, and retain its first indexed content+ and provenance across sanitizer changes. (#1057)- Documented FutureInfra as an endpoint for the existing `openai-compat`provider. (#1026)- `.github/workflows/nix.yml` builds the flake on `x86_64-linux` for path-diff --cc docs/security-boundaries.mdindex 30f5350e,1a284307..cb650a74--- a/docs/security-boundaries.md+++ b/docs/security-boundaries.md@@@ -41,7 -40,7 +41,8 @@@ boundary not yet built| 6 | Active-project pointer (PerActor, no clobber) | `ai-memory-core/src/active_project.rs` `set_for`/`lookup_for` (fail-closed on `Mismatch`) | `active_project.rs` `parallel_harnesses_of_one_user_keep_separate_pointers`, `two_operators_never_read_each_others_pointer`, `a_session_mismatch_fails_closed_once_anything_has_been_keyed` | STRONG || 6b | Native `_meta` routing coordinate is routing-only (never grants identity) | `ai-memory-mcp/src/server.rs` `attach_native_session` reads only `_meta["ai.opencode/sessionID"]` into `ActorKey.session_id` (trimmed, non-empty-string-validated); `user` still comes from the authenticated `ActorContext`, so a forged `_meta` cannot cross a user/scope boundary — it only selects a session slot behind the existing `active_project` guard | `server.rs` `native_session_metadata_is_routing_only_and_preserves_precedence`, `native_session_metadata_validates_strings_without_granting_identity`; `autoscope_multiuser.rs` `native_metadata_routes_concurrent_reads_and_writes_to_hook_workspaces` (#864) | STRONG || 7 | Sanitizer trust boundary (invariant #6) | `ai-memory-core/src/sanitize.rs` `Sanitized<T>` (private field, only `sanitize()` ctor); `Sanitized::new` scrubs the title *before* the 80-char display cap; `WriterHandle::insert_observation` requires `Sanitized`; `ops` crate-private | Structural (compile-time) + `store/src/lib.rs` `insert_observation_boundary_scrubs_before_disk` + sanitizer scrub unit tests + `ai-memory-core::sanitize` `title_is_scrubbed_before_the_80_char_cap_runs` + `ai-memory-hooks::router` `issue_980_user_prompt_title_is_sanitized_before_truncated` (a secret straddling the 80-char boundary is redacted, not stored truncated; #980) | STRONG (structural) |+ | 7a | Eval observations: server provenance and reason privacy | `ai-memory-consolidate/src/auto_improve.rs` constructs private results from the existing execution, ignores extra model/scorer result fields and all eval results on report deserialization, hashes the evaluated request/bodies, and scrubs reasons before the 2,048-character cap and pending persistence; changed bodies cannot receive the earlier result | `auto_improve::tests::structured_eval_records_server_observation`; `tests/suite/eval_results.rs` `eval_reason_is_sanitized_before_pending_storage_with_legitimate_control` attempts forged deserialized reports and IDs/digests and malicious reasons with secrets/control characters, checks report and stored evidence before sidecar rendering, and preserves a legitimate reason and external evidence without independent results; fails with reason scrubbing or the report deserialization guard removed | STRONG |+| 7b | New public page metadata is bounded and cannot supply scope, author or admission controls; admin kind retains its legacy adapter | `ai-memory-core/src/page.rs` `PageWriteMetadata::into_frontmatter`; MCP validates all four fields; admin consumes legacy kind explicitly and shares entities/abstract/relations validation before scope creation; both use `Wiki::write_page` for sanitization/admission/authenticated attribution | `admin_write_page.rs` `write_page_metadata_rejects_invalid_payload_before_scope_creation` (invalid shapes, unknown relation kinds, raw-input over-limit values, untrimmed relation scopes and escaping paths refused; legitimate control admitted), `write_page_metadata_preserves_admin_auth_and_sanitization` (anonymous/DB-user refused, root control admitted with scrubbed metadata and authenticated attribution); `server.rs` `memory_write_page_metadata_rejects_invalid_before_scope_creation`, `memory_write_page_metadata_preserves_scope_author_and_sanitization` (foreign user denied; writer control admitted, forged frontmatter/author ignored, secrets scrubbed, invalid rewrite leaves disk and SQL latest unchanged); core `page_write_metadata_scope_components_refuse_surrounding_whitespace` and `page_write_metadata_limits_apply_before_trimming_and_normalization`; admin `write_page_metadata_admin_legacy_kind_matches_base` compares long/control-character kind behavior with the base adapter; entity-bound refusal bite-checked with its validation removed | STRONG || 8a | Messaging: recipient-only visibility | `ai-memory-store/src/ops.rs` pop target-select + `reader.rs` `list_messages` (`to_*` predicate) | `agent_messages.rs` `a_message_is_only_visible_to_its_recipient`; `agent_messages_tools.rs` non-recipient cannot pop | STRONG || 8b | Messaging: cancel-own-only | `ai-memory-store/src/ops.rs` `cancel_messages` (AND-gated on `from_*` sender coordinate) | `agent_messages.rs` — whole-outbox **and** a foreign **specific-id** cancel refused | STRONG || 8c | Messaging: pop-exactly-once | `ai-memory-store/src/ops.rs` `pop_message_in_transaction` atomic CAS `WHERE state='pending'` | `agent_messages.rs` — sequential **and** `tokio::join!` concurrent double-pop yields exactly one `Some` | STRONG |