Skip to content

The re-cut, step 2: the environment as a kernel module, its proposals in the review lane; the channel and router as MCP servers on it (S-219 to S-221) - #32

Merged
OpenReplicant merged 3 commits into
mainfrom
claude/recut-parts
Nov 27, 2026
Merged

OpenReplicant merged 3 commits into
mainfrom
claude/recut-parts

Conversation

@OpenReplicant

Copy link
Copy Markdown
Owner

docs/parts.md "Order" step 2: Substrate's parts in their types. This is the first slice, tested end to end.

What moved

  • The environment is a kernel module (S-219). environment/module.yaml and environment/migration.sql follow the kernel's module contract (its schema, modules/_template, at kernel e4ed8e2). scripts/kernel.sh init installs it with kk module install. The env schema is still migrated by environment/db.py, because the kernel applies a module's migration only once and has no upgrade step. 013_review_lane.sql gives the module's role env.review_waiting() and env.decide, and nothing else.
  • Proposals wait in the kernel's review lane. A new compose service, environment, runs environment/review.py in the kernel's image with kk.lib. It connects as the kernel's login and switches to kkm_environment. Each waiting action becomes one change set in the review lane: a sosa:Actuation with its actuator, its caller and its full input. A person approves or rejects it in the desktop's Review, alongside everything else the kernel holds. The service then records that decision on the action: approved actions are queued, rejected ones are refused with the reviewer's note. If a person approves their own request, it is refused, with the reason. Approved requests are kept as claims.
  • One place to decide. The MCP router no longer decides anything: its /api/decide endpoint and the page's Approve and Reject buttons are removed, and its role no longer has env.decide. scripts/env.py decide is also removed.
  • The channel connects as its own login (S-220): mcp_channel, role env_agent, password MCP_CHANNEL_DB_PASSWORD. It used to connect as the superuser. assistant.sh writes this login into the channel's MCP entry and tells the assistant to point people to Review.
  • The router was already a compose-service MCP server with its registry in the module's schema. Its docs now say so.
  • The assistant's view is already a view module in the kernel's desktop (S-221). Nothing more is built for it until a use case asks. ui/ stays, because maps as items (S-207) are not in the kernel yet.

Checked

  • scripts/tests/test_review.py (new, runs in the kernel's image): 19/19.
  • The other suites: environment 44 (4 new channel checks), kernel 27, UI 36, gateway 15, catalog 9, and the router's Go vet and tests. All of these ran on a separate Postgres.
  • End to end on a throwaway compose project (recut, with its own ports and volumes):
    • An agent's kernel_remember call went through the router and waited. It appeared in person_owner's review_queue, was approved with the kernel's own review tool, and was carried out by the kernel's connector.
    • A second call was rejected; router_outcome reports refused, by person_owner, "not now".
    • The channel, started from assistant.sh's settings, connected as mcp_channel.
  • Not run: scripts/check.sh against a full stack (gateway, Caddy, the browser trials). The new environment check in it was run on its own.

Merging with claude/preview-release

The two branches merge with no conflicts (checked with git merge-tree). After the merge, the new environment service still defaults to ${KERNEL_IMAGE_TAG:-main}; it should take the release's kernel tag like the other kernel services. Decision numbers S-219 to S-221 may need renumbering if the release adds decisions first.

For the owner

  • Privacy: an approved request's full input is now a claim in the kernel's default scope, so any agent with default clearance can read it. Before, it lived only in env.action. Whether proposals should get a scope of their own is your call.
  • Kernel follow-ups (optional):
    • kk module install gives a python-service module's role a new random login password on every run, even when the module is already installed. That login is unused here.
    • Module migrations have no upgrade step.
    • A rejection in the review lane sends no kernel_change_set notification, so the service checks every 5 s.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KhsqyyPmp7iKCkTFcXs6sh

OpenReplicant and others added 3 commits November 27, 2026 07:01
…iew lane; the channel on its own login (S-219, S-220)

- environment/module.yaml and migration.sql: the kernel's module contract; scripts/kernel.sh init installs it with
  kk module install. The env schema stays migrated by environment/db.py; 013_review_lane.sql gives the module's role
  env.review_waiting and env.decide, and takes env.decide from the router.
- environment/review.py (compose service `environment`, in the kernel's image with kk.lib): each waiting action
  becomes a change set in the review lane (a sosa:Actuation: actuator, caller, input in full); the reviewer's
  approval or rejection is recorded on the action; a request approved by its own caller is refused.
- The MCP router decides nothing: /api/decide and the page's buttons are gone; scripts/env.py decide is gone.
- The channel connects as mcp_channel (role env_agent, MCP_CHANNEL_DB_PASSWORD); assistant.sh writes it into the
  channel's MCP entry and tells the assistant to point people to Review.
- Tests: scripts/tests/test_review.py (19 checks, in the kernel's image), four new channel checks in
  test_environment.py, the router's Go tests updated; check.sh checks the module and its service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhsqyyPmp7iKCkTFcXs6sh
… the environment, the channel and the router are

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhsqyyPmp7iKCkTFcXs6sh
…it merges with the preview release's change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhsqyyPmp7iKCkTFcXs6sh
@OpenReplicant
OpenReplicant marked this pull request as ready for review November 27, 2026 18:09
@OpenReplicant
OpenReplicant merged commit e61bdd0 into main Nov 27, 2026
3 checks passed
OpenReplicant added a commit that referenced this pull request Nov 27, 2026
OpenReplicant added a commit that referenced this pull request Nov 27, 2026
… to S-222, then S-223

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

1 participant