Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "looperators-p0",
"interface": {
"displayName": "Looperators P0"
},
"plugins": [
{
"name": "looperators-agent-loop",
"source": {
"source": "local",
"path": "./plugins/looperators-agent-loop"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_USE"
},
"category": "Developer"
}
]
}
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,15 @@ release
*.sln
*.sw?

# Local project vision and design notes
# Internal project documentation (keep the legacy path blocked)
design-docs/
internal_docs/

# Local browser automation state
.playwright-cli/

# Local verification screenshots
acceptance-screenshots/
output/demo-screenshots/

# Headless acceptance run artifacts
output/acceptance/
output/ui-acceptance/
# Generated output and acceptance artifacts
/output/
6 changes: 5 additions & 1 deletion .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": ["dist/**", "dist-electron/**"],
"ignorePatterns": [
"dist/**",
"dist-electron/**",
"plugins/looperators-agent-loop/ui/assets/**"
],
"plugins": ["react", "typescript", "oxc"],
"rules": {
"react/rules-of-hooks": "error",
Expand Down
21 changes: 8 additions & 13 deletions agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ Branding boundary: the customer-facing product name is `looperators`. `Orrery` /
remains the internal codename and technical namespace; do not rename code symbols, IPC/MCP
names, environment variables, storage paths, CLI files, or historical records solely for rebranding.

For project vision and designs, please check the documentation under the `design-docs/`.
`agents.md` is a protected repository policy file. Modify it only when the user explicitly
authorizes changes to this file while knowing that `agents.md` itself will be edited; general
permission to edit code or documentation is not authorization.

- Vision / initial idea: `design-docs/reactive-agent-session-graph.md` — why looperators manages agents as a graph instead of a session list.
- Design (current source of truth for development): `design-docs/orrery-design.md` — the concrete control model (Skills membrane, Master Agent, scopes/clusters), UI shape, v1 scope, and the §12 Skill API.
- v1 plan: `design-docs/v1-implementation-plan.md` — phased implementation plan (critical path P0–P3 + parallel workstreams A–C), with goals and acceptance criteria.
- Internal implementation roadmap / current post-P4 baseline: `design-docs/internal_docs/plans/master-agent-plan-council-implementation-plan.md` — Master-as-Intent-Compiler/Governor/Replanner, Plan Council as the first high-frequency workflow, reliability convergence, correlation/barriers, dynamic topology, and concurrency/safety. Its rationale and discussion replay live in `design-docs/internal_docs/commit-log/2026-07-12-master-agent-plan-council-direction.md`. This roadmap supersedes the old priority of expanding manual canvas authoring first; existing kernel semantics remain governed by `design-docs/session-graph-kernel.md` until each migration phase lands.

- Verification: headless-first, three tiers — `npm run test:kernel` (kernel unit tests, fake providers allowed), `npm run acceptance:headless` (real-scenario acceptance on real providers with the cheap model preset, artifacts in `output/acceptance/`), then final UI acceptance. Commands are documented below; scenario-authoring rules live in `design-docs/AGENTS.md`.

For development and technical planning, follow the design doc and the v1 plan.
For project vision, design decisions, plans, and other internal context, consult the local,
Git-ignored `internal_docs/` directory and read only the documents relevant to the current task.

## Current product surface

Expand Down Expand Up @@ -126,14 +122,13 @@ npm run acceptance:membrane
```

Read the failed run's artifacts before rerunning. Scenario-authoring contracts,
workspace isolation rules, and evidence requirements are in
`design-docs/AGENTS.md` and `design-docs/headless-acceptance-harness.md`.
workspace isolation rules, and evidence requirements are kept in the local internal documentation.

### 3. Final UI acceptance

UI acceptance is the final, low-frequency tier after kernel and headless
acceptance pass. Follow the Browser/Computer Use assignment and model rules in
`design-docs/AGENTS.md`; do not turn UI clicking into the daily test loop.
the local internal documentation; do not turn UI clicking into the daily test loop.

## Provider setup notes

Expand Down Expand Up @@ -169,4 +164,4 @@ npm run cli -- graph
```

The full CLI debugging loop, programmatic orchestration client, and browser
preview setup are documented in `design-docs/AGENTS.md`.
preview setup are documented in the local internal documentation.
35 changes: 0 additions & 35 deletions electron/runtime/sessionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,6 @@
// - workflow proposals, wakeups, barriers
// - resource policy, run queue, launchRun, provider event stream
// - checkpoints/diffs, reports, persistence triggers
//
// Split-out knowledge domains (import, don't re-add here):
// runtimeCommon.ts shared value helpers + validation sets
// workspace/gitWorkspace.ts git/worktree/branch/checkpoint-ref/diff
// workspace/workspaceFiles.ts workspace file tree + open-in-app
// workspace/workspaceService.ts public workspace reads + open facade
// providers/providerConfigNormalize.ts provider instance/runtime config
// sessions/sessionInteraction.ts attachments + request/input normalization
// persistence/runtimeStateRecovery.ts state load/normalize/migrate/repair
// terminal/terminalService.ts embedded terminal subsystem
// subscriptionAuthoring.ts author_subscription input validation
// workspace/sessionCheckpoints.ts per-turn git checkpoints + diffs
// providers/providerSetupStatus.ts provider CLI/model-catalog probing
// control/commandRegistry.ts command kind + handler/policy registry
// control/commandExecutor.ts serialized transaction + effect authority
// clusters/clusterControlRuntime.ts Scope/Master/Loop/freeze topology control
// membrane/membraneRequestRuntime.ts sanctioned agent control-surface dispatch
// scheduler/schedulerRuntime.ts fact -> gate -> activation + timer lifecycle
// sessions/sessionRuntimeController.ts admission + provider turn lifecycle
// sessions/sessionCommandRuntime.ts session commands + channel/interaction adapters
// reports/reportFormatting.ts report/prompt render + payload validation
// queries/runtimeQueries.ts read-only state/kernel projections
// external/externalIngestionService.ts source registry, adapters + ingestion
// workflows/workflowKernel.ts the explicit kernel surface below
// workflows/governanceRuntime.ts wakeup + Barrier state machines
// workflows/proposalRuntime.ts Proposal/Patch authoring + commit
// workflows/classicWorkflows.ts draft/handoff/goal/connect + deployments
// workflows/planCouncil.ts plan council orchestration
// workflows/reviewWorkflow.ts review ring composer
// workflows/goalTemplates.ts goal loop + template library
// workflows/workflowShared.ts workflow resource compensation
//
// Growth stopline: new product workflows must not add new knowledge domains
// to this class; register the domain here and put the implementation in its
// own module (see design-docs/session-manager-split-plan.md).
import { randomUUID } from 'node:crypto'
import fs from 'node:fs'
import os from 'node:os'
Expand Down Expand Up @@ -1096,7 +1061,7 @@

#providerSetupHost(): ProviderSetupHost {
if (this.#providerSetupHostCache) return this.#providerSetupHostCache
const self = this

Check warning on line 1064 in electron/runtime/sessionManager.ts

View workflow job for this annotation

GitHub Actions / Unit checks

typescript(no-this-alias)

Unexpected aliasing of 'this' to local variable.
this.#providerSetupHostCache = {
get state() {
return self.#state
Expand All @@ -1112,7 +1077,7 @@

#checkpointHost(): CheckpointHost {
if (this.#checkpointHostCache) return this.#checkpointHostCache
const self = this

Check warning on line 1080 in electron/runtime/sessionManager.ts

View workflow job for this annotation

GitHub Actions / Unit checks

typescript(no-this-alias)

Unexpected aliasing of 'this' to local variable.
this.#checkpointHostCache = {
get state() {
return self.#state
Expand All @@ -1130,7 +1095,7 @@

#wf(): WorkflowKernel {
if (this.#wfKernel) return this.#wfKernel
const self = this

Check warning on line 1098 in electron/runtime/sessionManager.ts

View workflow job for this annotation

GitHub Actions / Unit checks

typescript(no-this-alias)

Unexpected aliasing of 'this' to local variable.
this.#wfKernel = {
get state() {
return self.#state
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Cooperative typed MCP checkpoint

Date: 2026-08-02

## Scope

This checkpoint removes Hooks and native-worker observation from the default Codex Plugin
surface. The loop is explicitly cooperative: root schedules one logical role at a time and the
worker reports through a typed, action-scoped MCP capability.

## Product surface

The default MCP server lists exactly eight tools:

1. `looperators_preview_loop`
2. `looperators_start_loop`
3. `looperators_pause_loop`
4. `looperators_resume_loop`
5. `looperators_cancel_loop`
6. `looperators_report`
7. `looperators_get_loop`
8. `looperators_get_snapshot`

Removed default surfaces include Hook collection/readiness, worker prepare/bind tools, probe
tools and inline graph rendering. Calling a removed tool by name returns method-not-found.

## Capability boundary

- The token is random and opaque. Its plaintext is never persisted; the shared store contains only
its SHA-256 digest and action identity.
- The durable record binds run, logical role, pending transition and pending action revision, so a
native worker's independent MCP process can validate the root-issued token.
- A token cannot act for the other role or a later action.
- Cancel and terminal state revoke the action.
- A new Governor MCP process rotates the current token on root `get_loop`; the Governor must not
perform that recovery read while a worker is in flight.
- Exact cross-process report retries remain idempotent after the transition advances.

This is not cryptographic proof of a native Codex subagent identity. That limitation is deliberate
in the default no-Hooks mode and is stated in the Plugin README and skill.

## Reproduction

From `/Users/observedobserver/Documents/GitHub/orrery`:

```sh
node --test --test-concurrency=4 plugins/looperators-agent-loop/tests/*.test.mjs
npm run test:plugin-agent-loop-ui
npm run lint
```

Observed result:

- direct Plugin suite: 60 passed, 0 failed;
- repository Plugin UI build plus suite: 60 passed, 0 failed;
- shared graph package typecheck/library/inline/embed builds passed as part of the repository script;
- lint exited 0 with pre-existing warnings; no new lint error.

The suite covers no-Hook start, logical bindings, token-plaintext non-persistence,
cross-controller and three-real-MCP-process reporting, implementer-to-reviewer
and reviewer-to-terminal transitions, wrong-role/stale token rejection, pause/resume, cancel,
restart rotation, idempotent and conflicting retries, concurrent reports, issues-to-cap,
verified snapshots, prepared-start crash recovery and real MCP stdio framing/tool dispatch.

## Deferred by design

The existing developer sidecar tests remain green, but the MCP-owned product sidecar and the full
shared ReactFlow production embed are the next checkpoint. No Desktop UI acceptance or fresh
Plugin install is claimed here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Desktop → shared graph interaction parity

- 日期:2026-08-02
- Gate:A / shared package independent checkpoint
- 状态:shared package independent checkpoint passed;Plugin integration pending
- 规则:`not-applicable` 必须说明 authority 不存在或 fixed review loop 不需要;不能用它
掩盖 shared package 缺失。

## Authority sources

- `src/components/session-graph-panel.tsx`:ReactFlow shell、selection、MiniMap、pan/zoom、
node/edge routing 与 inspector/loop panel composition。
- `src/components/canvas.tsx`:Agent node、relationship edge、loop badge 及状态视觉。
- `src/components/relationship-inspector-panel.tsx`:关系结构、状态、stop action。
- `src/components/loop-panel.tsx`:lap、issues、recovery、timeline、stop confirmation。
- `src/hooks/use-canvas.ts`:projection→flow elements、drag、position、selection semantics。
- `src/lib/graph-view.ts`:portable-ish node/edge/product view model 与 label/routing semantics。

`packages/agent-graph-ui` 已按本矩阵扩展并通过独立验收;Desktop 源文件仍是语义和交互
authority,Gate A/B 完成前不改 Desktop import。

## Matrix

| Desktop behavior | Classification | Shared/Plugin contract | Acceptance |
| --- | --- | --- | --- |
| ReactFlow canvas + dotted background | direct reuse | shared canvas shell | production bundle 可见且无 console error |
| pan / wheel zoom / zoom buttons / fit view | direct reuse | shared canvas shell | mouse 与 controls 自动化 |
| MiniMap pannable/zoomable | direct reuse | shared canvas shell | MiniMap 可见并可操作 |
| node / edge / pane selection | direct reuse | controlled/uncontrolled selection props | click、pane clear、live update 后 selection 稳定 |
| keyboard node/edge selection | direct reuse | focusable node/edge labels | Enter/Space + focus-visible tests |
| presentation node dragging | host adapter | shared emits position change;sidecar 保存在当前 Browser session,不写 projection | drag 后位置变化;snapshot 更新不篡改 authority |
| durable Desktop node positions | not-applicable | Codex Plugin 无 Desktop runtime position authority | sidecar 不调用 store mutation |
| Agent node card hierarchy | direct reuse | shared portable AgentNode view model | role/identity/state/activity/report variants screenshots |
| provider/model/vendor identity | host adapter | optional bounded fields;无可信数据时显示 logical role/runtime,不伪造 native provider | present/absent variants |
| running/master/managed/frozen visual states | direct reuse where modeled | shared state/tone mapping | state fixture matrix |
| latest verdict / issue count / report summary | direct reuse | typed projection adapter | issues/clean/done fixtures |
| relationship edge routing/stroke/dash/arrow | direct reuse | shared portable edge model | four review-loop relationships 无交叠/裁剪 |
| edge label, active/recent/pending, report count | direct reuse | typed relationship status | fixtures + live SSE update |
| Relationship inspector layout | direct reuse | portable `RelationshipInspectorModel` | From/When/Then/Gate/State/Stop condition visible |
| relationship stop button | host adapter | injected capability + callback;default review loop maps to pause/cancel preview | enabled/disabled/pending/error tests |
| Loop badge node | direct reuse | portable loop product summary | headline/lap/status/stop reason visible |
| Loop panel status summary | direct reuse | portable `LoopPanelModel` | responsible role/verdict/stop reason states |
| blocking issues list | direct reuse | typed report issues only | file/line/severity and empty states |
| lap cards + report timeline | direct reuse | bounded typed timeline | issues→clean multiple lap fixture |
| recovery guidance | direct reuse | interrupted/capped recovery model | restart/cap fixtures |
| stop confirmation copy/interaction | direct reuse + host adapter | shared confirmation UI + injected cancel callback | confirm/cancel/action-pending tests |
| open responsible Agent | host adapter | optional callback; hidden with an explicit unavailable explanation when Codex cannot deep-link | capability present/absent tests |
| open final diff/provider settings/workflow builder | not-applicable | sidecar has no stable Desktop runtime/navigation authority | no fake buttons or shell commands |
| freeze participants / cluster controls | not-applicable | fixed cooperative review loop has no cluster freeze authority | absent from Plugin bundle |
| drag-to-connect / create arbitrary Agent | not-applicable | fixed three-role recipe; general graph authoring is out of scope | handles non-connectable; no mutation endpoint |
| source/clock/cluster synthetic nodes | not-applicable | fixed review loop projection contains root/implementer/reviewer only | no placeholder nodes |
| kernel/activity overlay | host adapter | bounded typed projection timeline, never transcript/hook tail | SSE updates typed activity only |
| light/dark theme tokens | direct reuse | shared CSS variables with Desktop-compatible tokens | light/dark screenshots |
| responsive wide/narrow layout | direct reuse | shared deterministic routing/layout | wide/narrow no overlap/crop |
| reduced motion | direct reuse | media query disables nonessential animation | browser media emulation |

## Independent checkpoint

Plugin UI may not import the expanded package until 1–5 已通过;第 6 项在 Plugin 接入后、
Gate A 关闭前执行:

1. portable component/model source with no Electron/runtime/MCP import;
2. dev server and shipped production bundle;
3. automated interaction coverage for every `direct reuse` row and every applicable adapter row;
4. machine-readable result with zero console errors and request inventory;
5. light/dark + wide/narrow screenshots including MiniMap, Relationship inspector and Loop panel;
6. static audit proving the Plugin does not ship a second node/edge/inspector/loop-panel implementation.

## Checkpoint result

- 结果:PASS
- machine-readable evidence:`shared-package-checkpoint.json`
- production build/test:`npm test -w @looperators/agent-graph-ui`,6/6 pass
- dev Browser:真实 Chromium 验证 zoom、drag、keyboard selection、edge selection、
Relationship inspector、Loop panel/stop confirmation、wide/narrow、dark/light。
- production Browser:self-contained embed 显示 3 nodes + 4 edges + MiniMap;0 console error,
`performance` resource inventory 为空。
- 初次验收拦截并修复两项真实缺陷:受控节点丢失 measured state 导致节点隐藏/边不渲染;
重复 dimension change 导致 `ResizeObserver` warning storm。修复后重启 clean Browser session
并重复 panel/resize 操作,dev server 无新增 warning。
- screenshots:
- `output/playwright/agent-graph-ui-shared-checkpoint/graph-wide.png`
- `output/playwright/agent-graph-ui-shared-checkpoint/graph-narrow.png`
- `output/playwright/agent-graph-ui-shared-checkpoint/graph-light.png`
- `output/playwright/agent-graph-ui-shared-checkpoint/loop-panel-wide.png`
- `output/playwright/agent-graph-ui-shared-checkpoint/production-embed.png`

## Deferred Desktop migration

During Gate A/B the Desktop authority files remain unchanged. After Plugin acceptance, a separate
change switches Desktop imports to the accepted shared components and deletes the temporary duplicate
implementation. That later migration cannot weaken the Plugin checkpoint retroactively.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"schemaVersion": 1,
"reviewedAt": "2026-08-02",
"reviewer": {
"client": "Claude Code 2.1.218",
"model": "claude-fable-5",
"mode": "read-only",
"subagentsAllowed": false,
"webAllowed": false
},
"initialVerdict": "GO_WITH_AMENDMENTS",
"blocking": [],
"acceptedAmendments": [
"The shared package extraction scope is determined by the Desktop interaction parity matrix, not by the sidecar's current minimum needs.",
"The parity matrix is a required artifact with Desktop source references and classification reasons, and the shared package must pass an independent checkpoint before Plugin import."
],
"finalReview": {
"verdict": "GO",
"amendmentsClosed": true,
"blocking": [],
"consensus": "Desktop graph components and interactions are the authority baseline. Extract and independently accept the shared package first, integrate it into the Plugin second, and change Desktop imports only after Plugin acceptance."
}
}
Loading
Loading