Skip to content

feat(agent): restack Maple on master#167

Draft
AnthonyRonning wants to merge 7 commits into
masterfrom
agent-rewrite
Draft

feat(agent): restack Maple on master#167
AnthonyRonning wants to merge 7 commits into
masterfrom
agent-rewrite

Conversation

@AnthonyRonning

Copy link
Copy Markdown
Contributor

Summary

  • restack Maple onto current master as a clean 6-commit series
  • preserve the existing agent runtime, Brave search, push delivery, onboarding, schedules, and emoji reactions
  • intentionally leave docs/ and internal_docs/ out of this branch while keeping the code path near-identical to agents

Commit stack

  1. feat(rag): add encrypted embeddings foundation
  2. feat(agent): add core Maple runtime and persistence
  3. feat(agent): add history, Brave search, and push delivery
  4. feat(agent): add explicit main-agent onboarding
  5. feat(agent): add schedules and preference tools
  6. feat(agent): add emoji reactions and persisted SSE ids

Validation

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features

Notes

  • This is the cleaned restack of the existing agents work.
  • Remaining deltas vs agents are intentionally limited to omitted docs/internal docs, PCR JSON drift, joinable ordering in src/models/schema.rs, and #[allow(dead_code)] on insert_message_embedding in src/rag.rs.

@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cd9225d1-ee2f-491c-91f6-b59827ef5bab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent-rewrite

Comment @coderabbitai help to get the list of available commands.

@AnthonyRonning
AnthonyRonning force-pushed the agent-rewrite branch 6 times, most recently from e90f3bf to 2289257 Compare April 14, 2026 03:37
@AnthonyRonning
AnthonyRonning force-pushed the agent-rewrite branch 8 times, most recently from 0bd4a8c to 93e359c Compare April 28, 2026 02:34
AnthonyRonning and others added 6 commits May 6, 2026 00:23
Introduce the encrypted embedding storage and retrieval primitives on top of the existing schema so later agent features can build on a stable RAG base.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Introduce the main Maple agent runtime, persistence models, and hidden backing conversation flow so the restacked branch has a working end-to-end agent foundation on top of the new schema.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Expand Maple with paginated history and reset controls, Brave-backed web search, and encrypted mobile push delivery so the runtime can surface richer results and notify clients off-thread.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

fix(push): avoid FCM and Tinfoil router 0 bind conflict

Move FCM onto its own loopback IP so the push and Tinfoil router forwarders can both bind cleanly on agent-rewrite.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Switch Maple creation from implicit lazy bootstrapping to an explicit init flow that seeds onboarding messages and stores user locale and timezone hints for later agent runs.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Add background Maple wakeups with durable leases and retry handling, and let the agent update validated user preferences that can influence schedule timing and future replies.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Let Maple store lightweight reply reactions and require persisted message identifiers in its SSE flow so clients can reconcile streamed output with durable conversation state.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@AnthonyRonning

Copy link
Copy Markdown
Contributor Author

Nitro parent-side docs gap from this branch: entrypoint.sh adds APNs/FCM egress forwarders, but docs/nitro-deploy.md does not yet include matching parent allowlist entries or systemd vsock-proxy services for them.

Branch-specific mappings currently in entrypoint.sh:

  • api.push.apple.com -> enclave 127.0.0.21:443, parent vsock 8024
  • api.sandbox.push.apple.com -> enclave 127.0.0.22:443, parent vsock 8025
  • fcm.googleapis.com -> enclave 127.0.0.20:443, parent vsock 8029

This is separate from the Intel PCS fix, which is now on 127.0.0.40/41 and 8048/8049. Ignoring the older OpenAI 8002 doc drift here since it predates this PR.

Comment thread src/push/crypto.rs

let salt = generate_random::<32>();
let hkdf = Hkdf::<Sha256>::new(Some(&salt), shared_secret.raw_secret_bytes().as_slice());
let mut key = [0_u8; 32];
Comment thread src/push/crypto.rs
ephemeral_public.as_affine(),
);
let hkdf = Hkdf::<Sha256>::new(Some(&salt), shared_secret.raw_secret_bytes().as_slice());
let mut key = [0_u8; 32];
Comment thread src/push/fcm.rs
let body = build_fcm_payload(event, push_token, preview_payload);
let response = transport
.client
.post(format!(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants