Skip to content

Align workspace conventions with openclaw; workspace-as-anchored-git soul #79

Open

Description

@melvincarvalho

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.

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

  1. added a commit that references this issue on Jun 12, 2026
  2. melvincarvalho commented on Jun 12, 2026

    @melvincarvalho
    ContributorAuthor

    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.

    • Session transcripts moved from the workspace (agents/<id>/.jsclaw-micro/sessions/) to the state root (data/sessions/<agentId>/).
    • The runner is stateless: prior transcript arrives in ContainerInput.messages, the updated array returns in ContainerOutput.messages, the host's SessionStore persists it (host-minted ids). agent-micro's session.js is deleted.
    • Runner-agnostic: the Claude Code SDK runner keeps its own sessionId continuity (already outside the workspace); only agent-micro changed.
    • The agent workspace is now identity + memory only — verified live: continuity held across turns with the runner persisting nothing, and no .jsclaw-micro/ reappeared.

    Remaining phases

    • 1b two-layer memory (MEMORY.md always + memory/YYYY-MM-DD.md on-demand) — runner-side ×2
    • 1c per-agent skills/ precedence (Share the skills ecosystem with openclaw — one SKILL.md world #47 item)
    • Phase 0 port openclaw's normalizeAgentId slugifier (admits hex-pubkey agentIds, closes path traversal) — do before more agentId-as-path surface lands
    • Phase 2 workspace init/anchor (git + gitmark)
    • card.jsonld WebID profile — its own phase, did:nostr↔WebID design, cross-linked to JSS
  3. added a commit that references this issue on Jun 12, 2026
  4. melvincarvalho commented on Jun 12, 2026

    @melvincarvalho
    ContributorAuthor

    Phase 0 done (#81): ported openclaw's normalizeAgentId slugifier, 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/pwned is contained (slugified to agents/tmp-pwned, no escape). Remaining: 1b two-layer memory, 1c per-agent skills, then Phase 2 (git/gitmark) + card.jsonld.

  5. added a commit that references this issue on Jun 12, 2026
  6. melvincarvalho commented on Jun 12, 2026

    @melvincarvalho
    ContributorAuthor

    Phase 1b done (jsclaw #82 + agent-micro#13): two-layer memory. MEMORY.md loaded in full (curated, always-on); memory/*.md surfaced 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 in memory/codewords.md required (and got) a read_file, proving bodies stay out of the prompt while recall stays complete. Remaining: 1c per-agent skills, then Phase 2 (git/gitmark) + card.jsonld.

  7. added a commit that references this issue on Jun 12, 2026
  8. melvincarvalho commented on Jun 12, 2026

    @melvincarvalho
    ContributorAuthor

    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 and commands.list respect ctx.agentId. Verified live: Scuttle's creed, living only in agents/main/skills/, surfaced and ran from the per-agent path.


    Phase 1 complete — 100% workspace alignment with openclaw

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions