Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
8e72652
fix(execution): drain completions with no newly scheduled work
the-mindful-dude Nov 4, 2026
63cd9f2
fix(storage): serialize concurrent transactions instead of reporting …
the-mindful-dude Nov 4, 2026
9909032
feat(planner): reject conflicting target paths across bindings
the-mindful-dude Nov 4, 2026
6ea603b
test(acceptance): keep independent branch config out of upstream mapping
the-mindful-dude Nov 4, 2026
d9c13d3
chore(scripts): fail validation on unformatted Go files
the-mindful-dude Nov 4, 2026
173ae97
feat(phase-3): join correctness and fan-in runtime support
the-mindful-dude Nov 4, 2026
ec6f902
feat(phase-2): storage providers and migrations completion
the-mindful-dude Nov 4, 2026
d24a93b
docs: rename PRIORITY_TODO.md to TODO.md and remove from gitignore
the-mindful-dude Nov 4, 2026
2dc2027
feat(durable-execution): implement R4-1 assembly identity in snapshot…
the-mindful-dude Nov 4, 2026
0f981fa
fix/test: restore corrupted test files and formatting
the-mindful-dude Nov 5, 2026
4358fbf
fix/phase3-fan-in: extend R3-16 to reject join with predecessor in de…
the-mindful-dude Nov 5, 2026
1a8d952
feat/durability-config: add execution.durability deployment setting
the-mindful-dude Nov 5, 2026
06a0557
feat/execution-snapshot: persist assembly identity fields
the-mindful-dude Nov 5, 2026
6a38cee
feat/artifact-retention: reference-aware Delete and Register tracking
the-mindful-dude Nov 5, 2026
4b549c6
feat/dispatch-intent: add transactional transition + dispatch intent …
the-mindful-dude Nov 5, 2026
4e3b7d3
feat/recovery-protocol: add recoverExecutions skeleton
the-mindful-dude Nov 5, 2026
92bec8f
feat/durable-execution: commit core implementation changes
the-mindful-dude Nov 5, 2026
a42f629
docs(TODO.md): mark completed R4 items
the-mindful-dude Nov 5, 2026
d2685c8
feat(execution): version snapshot schema and persist recovery state
the-mindful-dude Nov 9, 2026
9ec43d2
feat(config): make execution durability mode authoritative
the-mindful-dude Nov 9, 2026
7e3dee7
fix: repair test fixtures and detached-chain validation
the-mindful-dude Nov 9, 2026
4eda12f
feat(instance): apply durability mode to restart sweep
the-mindful-dude Nov 9, 2026
d684b9f
feat(execution): add durable dispatch intent claiming
the-mindful-dude Nov 9, 2026
91d37e0
feat(execution): persist transitions and dispatch intents atomically
the-mindful-dude Nov 9, 2026
707b832
feat(instance): add durability mode configuration
the-mindful-dude Nov 9, 2026
b59e2f9
fix(execution): make durability modes truthful
the-mindful-dude Nov 10, 2026
2f015a7
fix(storage): make claims and revisions compare-and-swap
the-mindful-dude Nov 13, 2026
f3c6e3b
test(scheduler): wait for recorded cancellation before asserting
the-mindful-dude Nov 13, 2026
492847a
feat(execution): wire atomic transitions and dispatch
the-mindful-dude Nov 13, 2026
66879a5
feat(execution): recover durable executions after restart
the-mindful-dude Nov 13, 2026
cf115b3
feat(runtime): retain immutable artifacts and guard active executions
the-mindful-dude Nov 13, 2026
4988db8
docs(todos): move TODO.md into todos/
the-mindful-dude Nov 14, 2026
ab4bb0f
chore: remove stale R4-2_ANALYSIS.md
the-mindful-dude Nov 14, 2026
7b87d81
todo: add todos and implementation plans for neuron studio.
the-mindful-dude Nov 14, 2026
cd9e705
chore(agents): add coordinator-led multi-agent workflow
the-mindful-dude Nov 15, 2026
077344b
feat(phase4): complete durable execution and recovery items
the-mindful-dude Nov 15, 2026
228c11e
feat(execution): add failure propagation for fan-in joins (R3-22)
the-mindful-dude Nov 15, 2026
dd01e36
todos: mark R3-21 and R3-22 as complete
the-mindful-dude Nov 15, 2026
2256d0d
coordination: update ledger and todos for Phase 3 fan-in completion
the-mindful-dude Nov 15, 2026
a109561
feat(phase3): fan-in completion and R3-25-R3-30 criteria; feat(phase5…
the-mindful-dude Nov 16, 2026
f336b7b
feat: Phase 3 fan-in completion + Phase 5 WaitUntil foundation + pre-…
the-mindful-dude Nov 16, 2026
915e855
feat(phase5): signals timers wait metadata signal API timer storage
the-mindful-dude Nov 16, 2026
6043255
feat(phase5): mark R5-1..R5-3,R5-8,R5-10,R5-11 complete + fix memory …
the-mindful-dude Nov 16, 2026
e9af770
docs(todos): re-open unimplemented Phase 5 items and record findings
the-mindful-dude Nov 16, 2026
0a4b42d
fix(test): repair storage fakes and gofmt drift
the-mindful-dude Nov 16, 2026
5e4a335
chore(agents): add Phase 5 plan, ADR, and ledger
the-mindful-dude Nov 16, 2026
3d2e6d5
fix(test): make acceptance shutdown idempotent and R4-24 assertions real
the-mindful-dude Nov 16, 2026
157ac66
feat(protocol): add negotiated suspend/resume to capability runtime a…
the-mindful-dude Nov 16, 2026
15be2dc
chore(agents): record T-021, T-023, and T-033 evidence
the-mindful-dude Nov 16, 2026
18dc6a6
fix(runtime): fail closed on unsupported suspend outcomes
the-mindful-dude Nov 16, 2026
100d9dd
fix(sdk): validate suspend outcomes and align negotiation
the-mindful-dude Nov 16, 2026
23aca93
feat(storage): add indexed durable timer substrate
the-mindful-dude Nov 16, 2026
8a01be9
fix(storage): add timer lease renewal and ownership fencing
the-mindful-dude Nov 17, 2026
ce13556
docs(agents): align ADR 0001 with timer substrate
the-mindful-dude Nov 17, 2026
d295bdf
feat(storage): harden timer migrations for legacy rows and concurrency
the-mindful-dude Nov 17, 2026
367c932
chore(agents): record T-035 and timer hardening findings
the-mindful-dude Nov 17, 2026
f82ffa6
fix(storage): make timer lease fencing fail closed
the-mindful-dude Nov 17, 2026
ab23e5a
fix(storage): add v4 timer migration and concurrency-safe startup
the-mindful-dude Nov 17, 2026
c8bb501
docs(agents): record T-037 signoffs and T-038 migration decision
the-mindful-dude Nov 17, 2026
a78a366
fix(storage): harden timer migration startup and DSN tests
the-mindful-dude Nov 17, 2026
45f42ca
docs(agents): accept T-038 migration strategy and record reviews
the-mindful-dude Nov 17, 2026
235cd46
docs(agents): close T-022 and T-038 with final reviews
the-mindful-dude Nov 17, 2026
aca1834
docs(todos): mark verified timer substrate item complete
the-mindful-dude Nov 17, 2026
2b9dcaa
feat(execution): add durable wait domain and snapshot v3
the-mindful-dude Nov 17, 2026
7e7e633
feat(execution): add atomic wait transition store
the-mindful-dude Nov 17, 2026
039a782
docs(agents): record durable wait domain and transition store
the-mindful-dude Nov 17, 2026
059cae7
feat(execution): add scheduler wait transitions and timer poller
the-mindful-dude Nov 17, 2026
7fcf97f
docs(agents): record scheduler wait and timer poller slice
the-mindful-dude Nov 17, 2026
ffa4d57
fix(execution): clean up wait timers on cancellation
the-mindful-dude Nov 17, 2026
e7ab02e
fix(execution): recover durable waiting executions
the-mindful-dude Nov 17, 2026
cf3e6a6
docs(agents): record cancellation, recovery, and follow-up work
the-mindful-dude Nov 17, 2026
1a8051d
test(instance): verify durable wait recovery boundary
the-mindful-dude Nov 19, 2026
215c262
docs(phase5): record recovery verification and follow-up state
the-mindful-dude Nov 19, 2026
29c3ab0
test(execution): remove dispatch claim lease race
the-mindful-dude Nov 19, 2026
aa24624
fix(execution): serialize shared wait transitions
the-mindful-dude Nov 19, 2026
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
79 changes: 79 additions & 0 deletions .agents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Multi-Agent Workspace

This directory is the durable, project-local coordination surface for the global specialist agents defined in `~/.config/opencode/agents/`.

It is intentionally versioned so that a fresh session can resume work without relying on chat history.

## Files

| Path | Purpose | Writer |
|---|---|---|
| `ledger.yaml` | Authoritative task ledger: scope, owner, dependencies, acceptance, verification, status, lease, evidence | coordinator |
| `ownership.yaml` | Path-to-owner map and sign-off triggers | coordinator |
| `reports/<task-id>.md` | One report per delegated task, including checks and exact outcomes | task owner |
| `decisions/NNNN-<slug>.md` | Architecture decision records | architect |
| `reports/handoff-<timestamp>.md` | Compaction or session handoff record | coordinator |

The project's `todos/` directory remains the product backlog. `ledger.yaml` tracks active execution; it does not replace `todos/`.

## Agent roster

| Agent | Mode | Writes | Purpose |
|---|---|---|---|
| `coordinator` | all | `.agents/**` only | Owns scope, ledger, leases, delegation, integration, validation |
| `architect` | subagent | `.agents/decisions/**` | Boundaries, dependency direction, isolation, scalability, ADRs |
| `coder` | subagent | leased source paths | Bounded implementation with tests |
| `bugfixer` | subagent | leased source paths | Reproduction-first defect repair with regression tests |
| `reviewer` | subagent | none | Correctness, regressions, acceptance, boundaries |
| `security` | subagent | none | Supply chain, secrets, isolation, permissions, resource bounds |
| `documenter` | subagent | docs and markdown | Documentation synchronized with verified behavior |

## Ledger schema

```yaml
version: 1
tasks:
- id: T-001
objective: "One sentence, observable"
scope: ["path/or/module/**"]
owner: coder
reviewer: reviewer
signoff: [architect]
dependencies: []
acceptance:
- "Observable criterion"
verification:
- "Exact command or method"
status: not_started
lease: null
evidence: []
reports: []
open_risks: []
```

Valid states: `not_started`, `in_progress`, `blocked`, `needs_review`, `done`.

A task may move to `done` only when every acceptance criterion is verified and every required check is recorded in `evidence`. A `blocked` task must name the blocker, its impact, and the condition to resume.

## Lease protocol

1. Read `ownership.yaml` and assign a mutating owner.
2. Claim a lease in the ledger: `lease: { owner: coder, paths: [...], task: T-001 }`.
3. Do not run overlapping mutating tasks. Queue instead.
4. Release the lease when the task reaches `needs_review` or `done`.
5. Read-only agents never need a lease and may run in parallel.

## Required sign-off

| Trigger | Required |
|---|---|
| Any non-trivial change | `reviewer` |
| Module boundary, dependency direction, public contract, folder layout, persistence, concurrency, isolation | `architect` |
| Runtime, registry, resolver, installer, artifact, storage, provider, daemon, auth, secrets, dependencies, CI, scripts, executor protocol | `security` |
| User-facing behavior, CLI, configuration, public API, docs | `documenter` |

The coordinator may not waive a required sign-off without recording the reason and the residual risk in the ledger.

## Handoff

Before compaction or handoff, write `reports/handoff-<timestamp>.md` with the objective, branch and tree state, verified facts (`file:line`), decisions and rejected approaches, ledger snapshot, commands run with exact outcomes, open risks, and the next safe action. Instruct the next agent to read `AGENTS.md` in full before acting.
Empty file added .agents/decisions/.gitkeep
Empty file.
574 changes: 574 additions & 0 deletions .agents/decisions/0001-phase5-signals-timers.md

Large diffs are not rendered by default.

286 changes: 286 additions & 0 deletions .agents/decisions/0002-timer-migration-strategy.md

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions .agents/decisions/0003-wait-recovery-semantics.md

Large diffs are not rendered by default.

210 changes: 210 additions & 0 deletions .agents/decisions/0004-wait-transition-serialization.md

Large diffs are not rendered by default.

748 changes: 748 additions & 0 deletions .agents/ledger.yaml

Large diffs are not rendered by default.

159 changes: 159 additions & 0 deletions .agents/ownership.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
version: 1
project: neuron
default_owner: coordinator
mutating_owners:
implementation: coder
defect_repair: bugfixer
read_only_agents:
- architect
- reviewer
- security

# Sign-off triggers are path-based. A task touching any matching path must
# obtain the listed sign-off before moving to done.
signoff_triggers:
architecture:
- application/compiler/**
- application/language/**
- application/loader/**
- application/project/**
- application/runtime/**
- application/capabilityruntime/**
- application/provider/**
- application/client/**
- application/daemon/**
- application/config/**
- application/connection/**
- application/process/**
- application/build/**
- application/cmd/**
- application/internal/**
- nore/internal/assembly/**
- nore/internal/contracts/**
- nore/internal/planner/**
- nore/internal/execution/**
- nore/internal/invoke/**
- nore/internal/instance/**
- nore/internal/event/**
- nore/internal/stream/**
- nore/internal/types/**
- nore/internal/builtins/**
- nore/internal/analytics/**
- packages/assembly-sdks/**
- packages/executor-sdks/**
- shared/protocol/**
- shared/types/**
- shared/version/**
- go.work
- pnpm-workspace.yaml
security:
- nore/internal/registry/**
- nore/internal/resolver/**
- nore/internal/plugin/**
- nore/internal/mechanism/**
- nore/internal/runtimeconfig/**
- nore/internal/storage/**
- nore/internal/data/**
- nore/internal/api/**
- nore/cmd/**
- application/internal/artifact/**
- application/internal/githubrepo/**
- application/internal/providerctl/**
- application/internal/runtimectl/**
- application/internal/sourceregistry/**
- application/internal/ref/**
- application/daemon/**
- application/provider/**
- application/process/**
- scripts/**
- .github/**
- go.work.sum
- pnpm-lock.yaml
- packages/executor-sdks/**
- shared/protocol/**
documentation:
- docs/**
- README.md
- AGENTS.md
- examples/**

modules:
- id: coordination
paths:
- .agents/**
owner: coordinator
notes: Ledger, ownership, reports, decisions, handoff records.

- id: application-core
paths:
- application/**
owner: coder
notes: >-
Compiler, loader, language, project, runtime, capability runtime,
provider, client, daemon, config, connection, process, build, cmd, and
application-internal packages. Preserve source-language-independent
compiler behavior and runtime isolation boundaries.

- id: nore-engine
paths:
- nore/**
owner: coder
notes: >-
Execution engine: assembly, contracts, planner, execution, invoke,
instance, event, stream, types, builtins, registry, resolver, plugin,
mechanism, runtimeconfig, storage, data, analytics, api.

- id: assembly-sdks
paths:
- packages/assembly-sdks/**
owner: coder
notes: Public authoring SDKs. Treat APIs as contracts; require type tests.

- id: executor-sdks
paths:
- packages/executor-sdks/**
owner: coder
notes: Capability runtime SDKs. Protocol and security sensitive.

- id: shared
paths:
- shared/**
owner: coder
notes: Protocol, shared types, version. Contract-sensitive.

- id: examples
paths:
- examples/**
owner: coder
notes: Keep runnable; documenter verifies instructions.

- id: docs
paths:
- docs/**
- README.md
owner: documenter
notes: Must reflect verified code behavior.

- id: repository-contract
paths:
- AGENTS.md
owner: coordinator
notes: Project contract.

- id: backlog
paths:
- todos/**
owner: coordinator
notes: Product backlog. Ledger tracks active execution.

- id: tooling
paths:
- scripts/**
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
- go.work
- go.work.sum
- .github/**
owner: coder
notes: Build, release, install, and validation tooling. Security sign-off required.
Empty file added .agents/reports/.gitkeep
Empty file.
40 changes: 40 additions & 0 deletions .agents/reports/R4-19-implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Implementation — R4-19

status: in_progress
lease:

## Changed
- `shared/protocol/capabilityruntime/v1/capability_runtime.proto:86-89` — added `attempt_id` and `logical_operation_id` fields to `ExecuteRequest`
- `shared/types/protocol/instance.go:135-143` — added `AttemptID` and `LogicalOperationID` fields to `ExecuteRequest` struct
- `nore/internal/contracts/capabilityruntime.go:56-83` — added `AttemptID` and `LogicalOperationID` fields to `ExecutionContext` struct
- `nore/internal/mechanism/process/worker.go:593-619` — wired `AttemptID` and `LogicalOperationID` from context to `v1.ExecuteRequest`
- `packages/executor-sdks/golang/capabilityruntime.go:193-214` — pass through `AttemptID` and `LogicalOperationID` in `Execute` handler

## Behavior
- The gRPC `ExecuteRequest` now carries optional `attempt_id` and `logical_operation_id` fields (proto3, backward compatible)
- The `ExecuteRequest` HTTP API body includes these fields for idempotency awareness
- The execution context carries `AttemptID` and `LogicalOperationID` from the Neuron execution engine
- The Go process worker populates these fields on the gRPC `ExecuteRequest` before sending to the capability runtime
- Existing runtimes receive empty strings for the new fields, maintaining backward compatibility

## Verification
- Proto compilation: `protoc` validation
- Go type check: `go vet` on affected packages
- Existing tests compile and pass
- SDK Execute handler passes through new fields

## Risks and limitations
- Proto3 optional fields with zero value (= "") ensure backward compatibility
- Existing capability runtimes that don't understand these fields will receive empty strings
- Requires coordination with .NET and TypeScript SDK updates (outside Go scope)
- Wiring execution context IDs to the worker requires context propagation changes

## Discovered but not fixed
- .NET SDK field additions and protoc regeneration (outside current lease)
- TypeScript assembly SDK impact (orthogonal to gRPC protocol)
- HTTP API integration points for the new fields

## Next safe action
- Run `go vet` on affected packages
- Run targeted tests for worker and SDK
- Verify proto compilation
26 changes: 26 additions & 0 deletions .agents/reports/R4-24-unused-variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Implementation — R4-24-unused-variable

status: complete
lease: nore/internal/instance/recovery_test.go

## Changed
- nore/internal/instance/recovery_test.go:482 — Removed unused variable declaration `capabilityID := shared.ID("cap_retry")` from `TestRecoveryDuringRetryBackoff` function. The variable was declared but never referenced; the function uses the string `"cap_retry"` directly throughout.

## Behavior
- No functional change. The test continues to operate on the `"cap_retry"` capability as before, but without the now-unused variable binding.

## Verification
- `go build ./nore/internal/instance/...` — passes
- `go vet ./nore/internal/instance/...` — vet error at line 594 (`MarkCapabilityWaiting undefined`) is pre-existing and unrelated to this change

## Tests added or updated
- None needed. The existing `TestRecoveryDuringRetryBackoff` function behavior is unchanged.

## Risks and limitations
- None. This is a clean removal of dead code.

## Discovered but not fixed
- None.

## Next safe action
- Task complete. The unused variable has been removed.
52 changes: 52 additions & 0 deletions .agents/reports/R4-26.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Defect repair — R4-26

status: fixed
lease: nore/internal/instance/

## Reproduction
- command: `go test ./nore/internal/instance/ -run TestRecoveryResumesAgainstOriginalArtifact -v -count=1`
- input: —
- failure before fix: test did not exist; execution had no verification against original artifact after version bump

## Root cause
- nore/internal/instance/manager.go:189-211 — The `recoveryKey` function builds a resolution key from the instance's persisted metadata (AssemblyID, Version, Hash, Env). When an execution is recovered after a runtime crash, this key is used with `assemblies.Resolve()`, which with a hash supplied calls `resolveByHash()` — an exact match that never falls back to the version index's latest entry. The root cause was that no test existed to verify this pinning behavior against registered version bumps.

## Fix
- nore/internal/instance/recovery_test.go:241-289 — Added `TestRecoveryResumesAgainstOriginalArtifact` which:
1. Registers assembly at v1.0.0 with hash "hash_v1"
2. Starts a durable execution on v1.0.0
3. Registers a NEW version 2.0.0 with different hash "hash_v2" (same assembly ID)
4. Stops the manager (simulating runtime crash/termination)
5. The manager reconciles and recovers the execution using `recoveryKey`, which prefers the metadata's hash "hash_v1"
6. `assemblies.Resolve` with the hash resolves via `resolveByHash` to the exact original artifact, not the newer v2.0.0
7. Verifies the execution completed successfully, proving artifact pinning works

## Regression test
- path: nore/internal/instance/recovery_test.go:241-289
- fails before fix: test does not exist
- passes after fix: `PASS` (see verification output)
- Also verifies: `TestRecoveryFailsExecutionWhenArtifactIsMissing` at recovery_test.go:291-315 still passes

## Verification
- `go test ./nore/internal/instance/ -run TestRecoveryResumesAgainstOriginalArtifact -v -count=1` — PASS
- `go test ./nore/internal/instance/ -run "TestRecovery" -v -count=1` — all 5 recovery tests PASS
- `go vet ./nore/internal/instance/` — clean
- `gofmt -l nore/internal/instance/recovery_test.go` — no unmapped files

## Related paths checked
- nore/internal/instance/manager.go:189-211 — `recoveryKey` prefers metadata hash/version; yes (same defect structure verified)
- nore/internal/assembly/repository.go:131-233 — `Resolve` with hash uses `resolveByHash` (exact match, never falls back to index); verified
- nore/internal/instance/recovery_test.go:235-259 — `TestRecoveryFailsExecutionWhenArtifactIsMissing` exists and passes; yes

## Risks and limitations
- risk: The test verifies the positive case (execution resumes against original artifact). The negative case (artifact deleted) is covered by the existing `TestRecoveryFailsExecutionWhenArtifactIsMissing` test.
- risk: No explicit test for "v1.0.0 artifact deliberately deleted after recovery starts" — covered by existing test pattern.

## Discovered but not fixed
- issue: —
- evidence: —
- why out of scope: —

## Next safe action
- Run `go test ./nore/internal/instance/ ...` periodically to ensure no regression
- If the durable execution model changes, verify `recoveryKey` still pins to the original hash
Loading
Loading