8000 M12.1–M12.6: kernel and user space — eject, layers, upgrades, kernel protection by adeelahmad · Pull Request #124 · adeelahmad/aloop · GitHub
[go: up one dir, main page]

Skip to content

M12.1–M12.6: kernel and user space — eject, layers, upgrades, kernel protection - #124

Merged
adeelahmad merged 1 commit into
masterfrom
claude/project-thread-zwxou3
Nov 20, 2026
Merged

adeelahmad merged 1 commit into
masterfrom
claude/project-thread-zwxou3

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

What

aloop is now split like an OS (ROADMAP M12, §4.15):

  • Kernel: the gates, hooks and audit log. These stay in the plugin and can never be overridden.
  • User space: the loop's opinions, meaning the 16 roles, the prompts and the skills. TDD is one opinion. They are ejected into docs/agents/userspace/ (tracked in git) on the first session or on aloop init --apply, and the project can change them freely.

aloop userspace

  • Commands: eject, status, which, upgrade, diff, merge, accept, reset, path [--home], apply, auto (run at SessionStart).
  • Layers, highest first: home (~/.aloop/projects/<name>-<hash>/), then repo, then plugin. Every apply logs userspace.applied with each file's layer and sha256. Only apply can write that event: events emit refuses it.
  • Customized roles are rendered as .claude/agents/<role>.md. aloop install codex|opencode|dsh renders the winning copies.
  • Upgrades are three-way, using .base/:
    • Untouched files follow the new plugin version.
    • An edited file is kept, and the new plugin text is written beside it as <rel>.plugin-new.
    • merge uses git merge-file. On a conflict it writes <rel>.merge and leaves your copy alone.

User space can't weaken the kernel

  • Editing reference/ (the gates, hooks.json, the pipeline) changes nothing.
  • An agent file for a role name the kernel has no gates for is never loaded.
  • gate-dispatch refuses aloop:<role> when that role is customized, so a customization isn't silently skipped.
  • No dispatched agent writes user space or ~/.aloop. The supervisor can't either while a sprint is live.
  • A worker diff that touches user space is blocked by targets diffscope. Before this change it was hidden as run data.
  • task-worktree merge refuses any branch that touches user space.
  • The managed .gitignore is now docs/agents/* plus !docs/agents/userspace/. A project's old docs/agents/ line under the managed header is rewritten in place.

Evidence

  • scripts/test/userspace.test.py: 48/48 pass. On master it fails at the first check, because no manifest is written.
  • make test-hosts, make shellcheck, pycheck, readme.test.py, check-tracking.py (120 requirements).

Calls (two-way, recorded)

  • The home layer lives at ~/.aloop/ rather than ~/.claude/projects/, because the latter is Claude-only and holds transcripts.
  • On Claude Code, a skill override is advisory: the session is told to follow the project's copy. Loading it for real is M12.9.
  • The gate scripts are copied as reference only.

Next (stacked PR)

M12.7 kernel extensions (~/.aloop/kernel/, hash-pinned, add-only) and M12.8 profiles and domain packs.


Generated by Claude Code

…protection

A project ejects the plugin's opinions (16 roles, skills, a kernel reference) into
docs/agents/userspace/ (in git) on its first session or init, and changes them freely.
home (~/.aloop/projects/<name>-<hash>) > repo > plugin per file; every apply logs the
copy used (userspace.applied, gate-owned). Customized roles render as
.claude/agents/<role>.md and through aloop install for Codex/OpenCode/dsh. Upgrades are
three-way: untouched files follow, an edit is kept with <rel>.plugin-new; diff, merge,
accept, reset.

The kernel is never overridden: reference/ copies change nothing, a role name the kernel
has no gates for is never loaded, gate-dispatch steers aloop:<role> to the customized
copy, no dispatched agent or live-sprint supervisor writes user space, a worker diff
touching it is blocked (diffscope) and task-worktree merge refuses such a branch.

Test: scripts/test/userspace.test.py (48 checks; fails on master at the first check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FeZyj8vyFzFFNgfzxTSoBd
@adeelahmad
adeelahmad marked this pull request as ready for review November 20, 2026 01:51
@adeelahmad
adeelahmad merged commit 069673f into master Nov 20, 2026
5 checks passed
adeelahmad pushed a commit that referenced this pull request Nov 20, 2026
adeelahmad pushed a commit that referenced this pull request Nov 20, 2026
…e door hook keeps M9.31's deadline, roles and question tools and takes M11.15's typed consent and test-scoped two-way drops, recorded after the alarm is disarmed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FeZyj7etMNXP3NuHLWrd4u
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

0