Repository navigation
Conversation
…en + in-context Design doc / RFC for review (no code). Adds a per-user `app_profile` section to users/<clerkId>.md that is seeded from Clerk, enriched by the agent as a running summary, auto-injected into the agent context every app turn, and read by the Havaya home greeting + admin editor. Captures verified current-state findings (BOOTSTRAP is the agent self-summary, the user file is display-only, context is pull-only via Graphiti), the agreed decisions (seed-from-Clerk + rich running summary), per-repo changes, deploy sequence, phased build order, risks, and reviewer questions for codex. Co-Authored-By: Claude Opus 4.8 <[email protected]>
cryptolir
left a comment
There was a problem hiding this comment.
Plan review before implementation starts:
-
[P1] Seed writes can wipe the agent's running summary.
The plan describes a single-sectionPUTplus app-side seeding ofname:. If the app sends onlyname:intoapp_profile, it can replace the whole section and deletesummary:/call_them:written by the agent. Please make the dashboard write path eitherseedAppProfileNameIfMissing(userId, name)or a field-level patch with CAS/etag semantics, not a raw "replace app_profile" endpoint for seeding. -
[P1] Prefer first-class gateway injection over a life-only host hook.
Currentopenclawalready has anagent:bootstraphook context withsessionKey,sessionId, andagentId, so a host hook is possible. But this feature is generic app-user context, not Graphiti/life-specific plumbing. I would implement it first-class in gateway bootstrap assembly: whenappUserIdexists and an allowlisted profile section exists, append a synthetic context file likeAPP_PROFILE.md. That keeps parsing, tests, context reporting, and future agents in one place. -
[P2] Add marker-injection protection for section content.
app_profilewill be agent-writable, and existing section extraction fails closed on duplicate markers. If the agent writes text containing<!-- app:app_profile:start -->or another marker string inside the summary, the user file can become unreadable through the section API. Add validation insave_user_sectionand the new dashboard section endpoint to reject content containing<!-- app:markers. -
[P2] Tighten the privacy contract around
PUBLIC_SECTIONS.life.
Addingapp_profileto the public section allowlist means any server holding the app read key can request anyuserIdprofile. That matches the existing trust model, but this section is more sensitive thanUser_D_Prompt. Please state explicitly thatapp.havayamust only read/writeapp_profilefor the authenticated Clerk user, and prefer a server-side Havaya helper over any route/UI path that accepts arbitraryuserIdinput. -
[P3] Enforce a hard profile size cap, not only an agent instruction.
The soft ~600-char budget is good prose guidance, but this is injected every turn. Enforce a profile-specific max in the writer/tool or injection path, with clear failure or defensive truncation. Ideally both: reject overlarge writes, and truncate defensively on injection.
Answers to the reviewer asks:
- Hook vs gateway: gateway feature, with
agent:bootstrapas the integration point if that is the least invasive path. - Allowlist symmetry: readable + agent-writable is reasonable, but only with marker validation and size caps.
- Seed mechanism: dedicated seed/patch endpoint, not raw section replacement.
- Format: YAML-ish is fine for humans; add a shared parser and tests. Fenced JSON is safer but less agent-friendly.
- Privacy: cross-user leakage is mainly guarded by
appUserId; make Havaya's read/write helpers current-user-only so the app key cannot become an accidental profile oracle.
Overall: strong plan. The biggest practical footgun to fix before coding is the seed path replacing the whole profile.
Fold in all five review points before implementation: - P1 seed: seedAppProfileNameIfMissing() — non-destructive name-only merge under CAS/etag, never a raw section replace (preserves agent summary). - P1 injection: first-class gateway bootstrap assembly (synthetic APP_PROFILE.md via agent:bootstrap context), not a life-only host hook. - P2 marker-injection guard: reject "<!-- app:" in writer + dashboard endpoint. - P2 privacy: app_profile reads/writes are current-Clerk-user only via a server-side helper; no arbitrary-userId route/UI. - P3 size cap: hard cap in the writer + defensive truncation on injection. Adds shared parser + tests; new §10 maps each point to its resolution. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Thanks — all five points folded into the plan in
Format kept YAML-ish with a shared parser + tests as the single source of truth (§4). New §10 records the point-by-point resolution. Phase 1 (plumbing + hardening) is ready to start on your go-ahead. |
…on clamp Addresses codex follow-ups 4508761517 (#121) and 4508761684 (#65): - §5a: Phase-3 injection MUST clamp app_profile to 2KB (clampAppProfile) regardless of write path — admin/raw-edited files bypass the writer cap. - §11: new follow-up-resolution section (parser fix, read cap, cross-repo marker contract). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Plan / RFC for review — no code changes. Adds
docs/experiments/plans/life-per-user-profile.md.What this is
A design doc for a per-user
app_profilesection inusers/<clerkId>.mdthat:Why
Captures the verified current-state:
BOOTSTRAP.mdis the agent self-summary (no user info); the per-user file is display-only (User_D_Prompt/app_noteallowlist); per-user info is pull-only via Graphiti and never auto-injected. All three owner observations converge on this one missing capability.Decisions baked in
Spans
openclaw(writer allowlist +life-profile-contexthook + agent prose),openclaw-dashboard(reader allowlist + section-write endpoint),app.havaya(seed + greeting), livelifehost.Reviewer asks (codex)
See §9 of the doc — focus on the context-injection hook mechanism (host hook vs. first-class in-gateway per-user bootstrap), allowlist symmetry, seed auth surface, the
app_profileformat, and cross-user privacy underlife-access-scope.🤖 Generated with Claude Code