Repository navigation
Description
Audit of openclaw's agent-workspace concept (docs.openclaw.ai/concepts/agent-workspace, 2026-06-12). jsclaw's workspace already matches the bones; the doc surfaces three upgrades, one of which is uniquely ours to build.
Already aligned
SOUL.md + identity-file load order (IDENTITY/AGENTS/TOOLS/USER), HEARTBEAT.md support, memory/ folder, per-agent workspace under agents/<id>/, skills/. The write loop works (Scuttle self-authored memory files).
Upgrades to take
1. Sessions out of the workspace (prerequisite refactor)
Today transcripts live inside the workspace: agents/<id>/.jsclaw-micro/sessions/ (agent-micro) — mixed with SOUL.md and memory. openclaw keeps sessions separate (~/.openclaw/agents/<id>/sessions/). Move jsclaw's session transcripts to data/sessions/<agentId>/ (alongside the existing data/sessions.json index from #57). The workspace should hold only identity + memory + skills — durable, human-authored content. This unblocks #3.
2. Two-layer memory
openclaw splits memory/YYYY-MM-DD.md (daily logs, retrieved on demand) from a curated MEMORY.md (long-term, loaded only in private sessions). jsclaw currently loads memory/*.md flat under a char budget. Adopt the split: dated daily logs surfaced on demand (like the skills index), MEMORY.md as the always-loaded curated index. This is the same architecture Claude Code's own memory uses (MEMORY.md index over atomic files) — proven, not speculative. Lives in the runner (agent-micro buildSystemPrompt + the default runner's memory loading).
3. Workspace as an anchored git repo — the novel one
openclaw's backup guidance: commit the workspace (SOUL/IDENTITY/AGENTS/TOOLS/USER/HEARTBEAT/memory) to a private git repo; never sessions, secrets, or credentials. jsclaw can go further because of this org's existing toolbox: a workspace git repo gitmark/blocktrails-anchored to Bitcoin makes an agent's soul and memory portable, versioned, and cryptographically timestamped on-chain. That is "credible exit" for an agent's identity (cf. JavaScriptSolidServer/JavaScriptSolidServer#448) — and nobody else in the ecosystem has the anchoring tools to do it.
jsclaw workspace init <agent>— git init the workspace with a sensible .gitignore (sessions/secrets excluded; Add task scheduler and heartbeat for autonomous operation #1 makes this clean)jsclaw workspace anchor <agent>— commit + gitmark to Bitcoin- Optional: a heartbeat-driven auto-commit/anchor cadence (gated by approvals Exec approvals: human sign-off for risky agent commands #58 once that lands)
Bonus confirmed by the doc
Workspace skills/ = highest precedence (per-agent overrides global skillsDir) — spec-validates the per-agent skills item deferred on #47. Implement agents/<id>/skills/ discovery layered over the global dir.
Also seen, deferred
BOOT.md (startup checklist on gateway restart), BOOTSTRAP.md (one-time first-run ritual, self-deleting), canvas/ (openclaw node displays — not applicable).
Sequencing
1 (sessions out — small, also tidies #57) → 2 (two-layer memory) and per-agent skills (#47) in either order → 3 (anchored-git, the headline). Each is independently shippable.
Activity
Merge pull request #80 from jsclaw/issue-79-1a-sessions
melvincarvalho commentedon Jun 12, 2026
Phase 1a done — option B (host owns sessions)
Shipped in #80 (jsclaw) + jsclaw/agent-micro#12. We chose B over the minimal relocate because the workspace is becoming a publishable/anchored identity unit (card.jsonld + git/gitmark), so a clean boundary earns its cost.
agents/<id>/.jsclaw-micro/sessions/) to the state root (data/sessions/<agentId>/).ContainerInput.messages, the updated array returns inContainerOutput.messages, the host's SessionStore persists it (host-minted ids). agent-micro'ssession.jsis deleted.sessionIdcontinuity (already outside the workspace); only agent-micro changed..jsclaw-micro/reappeared.Remaining phases
MEMORY.mdalways +memory/YYYY-MM-DD.mdon-demand) — runner-side ×2skills/precedence (Share the skills ecosystem with openclaw — one SKILL.md world #47 item)normalizeAgentIdslugifier (admits hex-pubkey agentIds, closes path traversal) — do before more agentId-as-path surface landsworkspace init/anchor(git + gitmark)Merge pull request #81 from jsclaw/issue-79-phase0-agentid
melvincarvalho commentedon Jun 12, 2026
Phase 0 done (#81): ported openclaw's
normalizeAgentIdslugifier, applied at every agentId entry boundary + a filesystem net. Verified live: a 64-char nostr pubkey works as an agentId (agents/<hex>/, the identity keystone), and../../../tmp/pwnedis contained (slugified toagents/tmp-pwned, no escape). Remaining: 1b two-layer memory, 1c per-agent skills, then Phase 2 (git/gitmark) + card.jsonld.Merge pull request #82 from jsclaw/issue-79-1b-memory
melvincarvalho commentedon Jun 12, 2026
Phase 1b done (jsclaw #82 + agent-micro#13): two-layer memory.
MEMORY.mdloaded in full (curated, always-on);memory/*.mdsurfaced as an on-demand index (filename + first-line hint, newest dated first), read with file tools — replacing the flat char-budget dump. Both runners updated. Verified live: a curated fact answered from the prompt; a codeword living only inmemory/codewords.mdrequired (and got) aread_file, proving bodies stay out of the prompt while recall stays complete. Remaining: 1c per-agent skills, then Phase 2 (git/gitmark) + card.jsonld.Merge pull request #83 from jsclaw/issue-79-1c-skills
melvincarvalho commentedon Jun 12, 2026
Phase 1c done (#83): per-agent skills.
agents/<id>/skills/loads on top of the global dir, per-agent overriding by name — openclaw's workspace-skills precedence and the #47 deferred item. No new mount (rides the workspace mount at/workspace/agent/skills); the command bridge andcommands.listrespect ctx.agentId. Verified live: Scuttle's creed, living only inagents/main/skills/, surfaced and ran from the per-agent path.Phase 1 complete — 100% workspace alignment with openclaw
normalizeAgentIdslugifier — pubkey-safe ids, traversal closed (feat: normalizeAgentId — pubkey-safe agent ids, traversal closed (#79 Phase 0) #81)The agent workspace is now exactly openclaw's shape — identity + memory + skills, nothing transient — and agentIds can be nostr pubkeys. Ready for Phase 2 (workspace init/anchor: git + gitmark) and card.jsonld (WebID profile, did:nostr↔WebID), the anchored-soul payoff this foundation was built for.