Repository navigation
feat(save-user-section): app_profile section + content guards (profile Phase 1) - #65
Conversation
…ase 1)
Per-user-profile plan Phase 1 (plumbing + hardening), addressing codex
review 4508313642:
- Add app_profile to WRITABLE_SECTIONS (writer allowlist).
- assertSectionContentWritable: reject nested app markers ("<!-- app:") and
enforce a per-section byte cap (app_profile 2KB, default 16KB), wired into
the tool write path. app_profile is injected into the prompt every turn, so
size is enforced, not just instructed.
- Tests + docs/tools/save-user-section.md updated.
Gate: vitest save-user-section 13/13; touched files type-clean (full-project
tsgo shows only pre-existing/unrelated errors).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@codex review Phase 1 (openclaw side) of the per-user-profile plan (#64, see its §10), resolving your review
Gate: |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
cryptolir
left a comment
There was a problem hiding this comment.
Follow-up review on the Phase 1 writer PR:
No major blocker in this PR. The substring marker guard is intentionally conservative, the 2 KB app_profile cap is reasonable, and enforcing before upsertSection is the right placement.
One cross-repo note for Claude: the marker guard is now a contract shared with dashboard #121 (content.includes("<!-- app:")). Please keep the writer and dashboard seed/read helpers aligned if this rule changes later. Also, Phase 3 gateway injection should still enforce/truncate defensively before injecting app_profile, because dashboard/admin-written files may not have gone through this writer path.
…follow-up) Per codex review 4508761684 on #65: document that the marker guard rule (content.includes("<!-- app:")) in assertSectionContentWritable must stay equivalent to containsAppMarker in openclaw-dashboard; change both together. Comment-only; vitest 13/13. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…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]>
|
Thanks — addressed in On the Phase-3 point: the plan §5a now explicitly requires the gateway injection path to clamp |
Make this branch oxfmt-clean (table padding, emphasis style, line-wrap). The remaining check/check-docs reds are PRE-EXISTING oxfmt drift in unrelated files on main (e.g. system-prompt.ts), not from this PR. No behavior change; vitest 13/13. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…oad_skill #74) (#75) Record the load_skill roll: #74 merged, gateway v2026.06.18.1 (sourceSha 09a99e4) pinned to life only — ships the full per-user stack to prod (writer #65/#66 + injection #68 + first-turn #71 + load_skill #74). Bump the INFRASTRUCTURE life-ahead tag to v2026.06.18.1 and note the US-host disk cleanup (97% to 67%, removed 8 unused/unreferenced gateway tags). Co-authored-by: Liran Peretz <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
Per-user-profile plan — Phase 1 (openclaw side): writer plumbing + hardening. Addresses codex review
4508313642on the plan (#64). No user-visible change; the livelifeagent is unaffected until the gateway image is rolled (Phase 3).What
app_profiletoWRITABLE_SECTIONSso the agent can maintain a per-user profile section viasave_user_section.assertSectionContentWritable, pure + exported + tested):<!-- app:— it would create duplicate markers and make the file fail closed on the section reader.app_profile2 KB, default 16 KB — enforced in the tool, not just instructed, becauseapp_profileis injected into the agent's context every turn.upsertSection); updated the tool/param descriptions anddocs/tools/save-user-section.md.Not in this PR (later phases)
PUBLIC_SECTIONS.life) + canonical format parser — pairedopenclaw-dashboardPhase-1 PR.seedAppProfileNameIfMissing(Phase 2, dashboard).APP_PROFILE.md(Phase 3).Gate
vitest run src/agents/tools/save-user-section.test.ts→ 13/13 passing (adds marker-guard + size-cap tests).tsgoshows only pre-existing/unrelated errors.🤖 Generated with Claude Code