Skip to content

Commit 7d98961

Browse files
authored
Cleanup/consolidate and gap analysis (#64)
* docs: consolidate CLAUDE.md into AGENTS.md Merge project-specific guidance from CLAUDE.md into AGENTS.md as the single entrypoint for all coding agents. CLAUDE.md now redirects to AGENTS.md. Changes: - Add 'What This Project Is' section (from CLAUDE.md) - Merge architecture doc reading list into Required Load Order - Add Project Rules (Do/Don't) section (from CLAUDE.md) - Expand Backpressure with build/doc commands under Nix wrappers - Deduplicate two overlapping architecture sections into one - Remove 'Related Documents' section (was CLAUDE.md pointer) - Update CONTRIBUTING.md references from CLAUDE.md to AGENTS.md * refactor: cleanup dead code, rename EffectExecutor, fix stale READMEs orch-kit: - Rename EffectExecutor -> EffectInterpreter (resolves name collision with neuron-effects-core::EffectExecutor; they're different abstraction levels) - Rename LocalEffectExecutor -> LocalEffectInterpreter - Rename runner_with_executor -> runner_with_interpreter - Remove unused tracing dependency - Remove dead _touch_errors placeholder function op-react: - Remove dead _tool_uses variable (data collected twice, first unused) READMEs (5 crates): - layer0: Fix test-utils names (EchoOperator, InMemoryStore, not Stub*) - neuron-mcp: Fix type names (McpClient/McpServer, not Bridge variants) - neuron-hooks: Fix Hook trait signature (on_event, not before_turn/after_turn) - neuron-tool: Fix trait name (ToolDyn.call, not Tool.invoke) - neuron-orch-local: Fix type name (LocalOrch, not LocalOrchestrator) All 393 tests pass. Clippy clean. Formatted. * chore: remove scratch plan file from tracking * docs: add Agent Constitution (CONSTITUTION.md) Normative document deriving from the Agentic Decision Map v3. Encodes core values (composability, effects boundary, slim defaults, protocol stability, explicitness) and Neuron's positions on all 23 architectural decisions. Format follows Anthropic's constitutional style: narrative explanation of WHY, not just WHAT. Structured as a universal template — other projects can fork and fill in their own positions. Also: - AGENTS.md: added to required reading list (#5), updated truth hierarchy (constitution > specs > rules > agent judgment) - release-please-config.json: excluded from release triggers * docs: tighten CONSTITUTION.md Cut from 268 to 155 lines (~42%). Same 5 values, same 23 positions. - Eliminated formulaic 'The principle / Positions' repetition - Removed 'orchestration protocol owns X' redundancy (was 8x) - Cut decision index table (duplicated narrative) - Varied rhythm across sections instead of rigid template - Sharpened voice from reference-manual to constitutional * refactor: reorganize workspace into domain-grouped directories Move 34 crates from flat repo root into 11 domain groups: turn/ neuron-turn, neuron-turn-kit, neuron-context, neuron-tool, neuron-mcp op/ neuron-op-react, neuron-op-single-shot orch/ neuron-orch-local, neuron-orch-kit effects/ neuron-effects-core, neuron-effects-local hooks/ neuron-hooks, neuron-hook-security state/ neuron-state-memory, neuron-state-fs env/ neuron-env-local provider/ neuron-provider-anthropic, neuron-provider-openai, neuron-provider-ollama secret/ neuron-secret + 6 backends auth/ neuron-auth + 4 backends crypto/ neuron-crypto + 2 backends layer0/ and neuron/ (umbrella) stay at root. Crate names, published package names, and all code unchanged. Updated: workspace members, 109 path dependencies across 26 Cargo.toml files, release-please-config.json, .release-please-manifest.json, README.md crate map. All 393 tests pass. Clippy clean. Formatted. * docs: update workspace layout in active docs after restructure - NEURON-REDESIGN-PLAN.md: rewritten workspace tree to match grouped layout - docs/architecture/validation-and-coordination.md: same - ralph_queue.md: fixed one path reference Historical docs/plans/* left untouched (historical record). * docs: decision map gap analysis — 23→24 decisions, expand D3A/D5/D4B/C1 Deep research across all 23 decisions in the Agentic Decision Map v3: - 8 parallel research runs covering Turn, Composition, and Lifecycle layers - Independence-tested 6 proposed new decisions against real architectures Results: - Add D3D (Output Shape) as genuinely new decision in inference cluster - Expand D3A table with two-level routing (model + reasoning effort) - Expand D5 with 4 new exit strategies (self-assessment, verification, loop detection, infeasibility) - Expand D4B with workload identity and proxy-mediated options - Expand C1 with trust/permission propagation model - Add Named Autonomy Configurations sidebar (D4A + C5 composite) - Add Development Lifecycle open questions (eval gating, versioning) - Update decision topology diagram and count (23 → 24) New documents: - decision-map-gap-analysis-2026.md — full research synthesis - decision-map-new-decision-audit.md — independence test methodology - gap-analysis-implementation-roadmap.md — code change spec - research-2026-03/ — 8 raw research reports + metadata * chore: delete 11 stub crates, keep neuron-secret-vault as reference Delete empty backend stubs that added crate count without substance: - auth: neuron-auth-{static,file,oidc,k8s} (53-69 lines each) - secret: neuron-secret-{env,aws,gcp,keystore,k8s} (77-121 lines each) - crypto: neuron-crypto-{vault,hardware} (109 lines each) Keep neuron-secret-vault as the reference stub for future backends. Workspace: 37 → 26 crates. Historical docs in docs/plans/ left as-is. * fix: pre-commit hook uses nix fmt instead of bare treefmt treefmt binary is not on PATH outside nix develop shell. Use 'nix fmt && git diff --exit-code' to match CI behavior. * fix: expose treefmt wrapper in devShell via treefmt-nix treefmt-nix was already wired as a flake module but config.treefmt.build.wrapper was not added to devShell buildInputs, so the treefmt binary was never on PATH. Add the wrapper to devShell so 'treefmt' is available inside nix develop. Pre-commit hook invokes via 'nix develop --command treefmt --fail-on-change' since hooks run outside the nix shell. * fix: correct stale relative links after domain-dir restructure; add lychee pre-commit hook 8 relative file links across 7 READMEs were broken by the workspace reorganization (crates moved into domain subdirectories): ../layer0 -> ../../layer0 (hooks, env, state crates) ../neuron-turn -> ../../turn/neuron-turn (provider crates) ../neuron-secret -> ../../secret/neuron-secret (env crate) Also add lychee (--scheme file) as a pre-commit hook so broken local links are caught before push, not by CI. HTTP links remain CI-only (offline, fast, no rate-limit flakiness). Exclude .direnv from .lychee.toml to avoid scanning nixpkgs READMEs. * fix: add missing crates to release-please manifest and config neuron-effects-core, neuron-effects-local, and neuron-turn-kit were present in the workspace but absent from release-please tracking. All three are publishable at 0.4.0.
1 parent f2d1816 commit 7d98961

File tree

213 files changed

+2037
-4853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+2037
-4853
lines changed

.lychee.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exclude = [
1919
]
2020

2121
# Exclude build artifacts and dependency docs
22-
exclude_path = ["target"]
22+
exclude_path = ["target", ".direnv"]
2323

2424
# Retry transient failures
2525
max_retries = 3

.pre-commit-config.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ repos:
33
hooks:
44
- id: treefmt
55
name: treefmt
6-
entry: treefmt --fail-on-change
6+
entry: nix develop --command treefmt --fail-on-change
77
language: system
88
pass_filenames: false
99
stages: [pre-commit]
1010

11+
- id: lychee-file-links
12+
name: lychee (file links)
13+
entry: lychee --scheme file --no-progress --config .lychee.toml
14+
language: system
15+
pass_filenames: true
16+
types: [markdown]
17+
stages: [pre-commit]
18+
1119
- id: clippy
1220
name: clippy
1321
entry: cargo clippy --workspace --all-features -- -D warnings

.release-please-manifest.json

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,27 @@
11
{
2+
"auth/neuron-auth": "0.4.0",
3+
"crypto/neuron-crypto": "0.4.0",
4+
"effects/neuron-effects-core": "0.4.0",
5+
"effects/neuron-effects-local": "0.4.0",
6+
"env/neuron-env-local": "0.4.0",
7+
"hooks/neuron-hook-security": "0.4.0",
8+
"hooks/neuron-hooks": "0.4.0",
29
"layer0": "0.4.0",
3-
"neuron-tool": "0.4.0",
4-
"neuron-turn": "0.4.0",
5-
"neuron-hooks": "0.4.0",
6-
"neuron-hook-security": "0.4.0",
7-
"neuron-context": "0.4.0",
8-
"neuron-op-react": "0.4.0",
9-
"neuron-op-single-shot": "0.4.0",
10-
"neuron-state-memory": "0.4.0",
11-
"neuron-state-fs": "0.4.0",
12-
"neuron-orch-kit": "0.4.0",
13-
"neuron-orch-local": "0.4.0",
14-
"neuron-env-local": "0.4.0",
15-
"neuron-secret": "0.4.0",
16-
"neuron-secret-env": "0.4.0",
17-
"neuron-secret-vault": "0.4.0",
18-
"neuron-secret-aws": "0.4.0",
19-
"neuron-secret-gcp": "0.4.0",
20-
"neuron-secret-keystore": "0.4.0",
21-
"neuron-secret-k8s": "0.4.0",
22-
"neuron-auth": "0.4.0",
23-
"neuron-auth-static": "0.4.0",
24-
"neuron-auth-file": "0.4.0",
25-
"neuron-auth-oidc": "0.4.0",
26-
"neuron-auth-k8s": "0.4.0",
27-
"neuron-crypto": "0.4.0",
28-
"neuron-crypto-vault": "0.4.0",
29-
"neuron-crypto-hardware": "0.4.0",
30-
"neuron-provider-anthropic": "0.4.0",
31-
"neuron-provider-openai": "0.4.0",
32-
"neuron-provider-ollama": "0.4.0",
33-
"neuron-mcp": "0.4.0",
34-
"neuron": "0.4.0"
10+
"neuron": "0.4.0",
11+
"op/neuron-op-react": "0.4.0",
12+
"op/neuron-op-single-shot": "0.4.0",
13+
"orch/neuron-orch-kit": "0.4.0",
14+
"orch/neuron-orch-local": "0.4.0",
15+
"provider/neuron-provider-anthropic": "0.4.0",
16+
"provider/neuron-provider-ollama": "0.4.0",
17+
"provider/neuron-provider-openai": "0.4.0",
18+
"secret/neuron-secret": "0.4.0",
19+
"secret/neuron-secret-vault": "0.4.0",
20+
"state/neuron-state-fs": "0.4.0",
21+
"state/neuron-state-memory": "0.4.0",
22+
"turn/neuron-context": "0.4.0",
23+
"turn/neuron-mcp": "0.4.0",
24+
"turn/neuron-tool": "0.4.0",
25+
"turn/neuron-turn": "0.4.0",
26+
"turn/neuron-turn-kit": "0.4.0"
3527
}

AGENTS.md

Lines changed: 118 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# AGENTS.md
22

3-
This file is the entrypoint for any coding agent (Codex, Claude Code, etc.) working in this repo.
4-
It defines what to load, in what order, and what quality gates must be satisfied before claiming
5-
work is complete.
3+
Entrypoint for any coding agent (Codex, Claude Code, etc.) working in this repo.
4+
Defines what to load, what the project is, and what quality gates must pass before claiming done.
5+
6+
## What This Project Is
7+
8+
Neuron is a Rust workspace implementing a 6-layer composable agentic AI architecture.
9+
Layer 0 (`layer0` crate) defines the stability contract: four protocol traits
10+
(Turn, Orchestrator, StateStore, Environment), two cross-cutting interfaces
11+
(Hook, Lifecycle events), and the message types that cross every boundary.
12+
Layers 1-5 build implementations on top.
613

714
## Prime Directive: One Task Per Context
815

916
Treat the context window like a fixed-size allocation: once you mix tasks, you lose coherence.
1017

11-
Rules:
12-
1318
1. One task per context window. If scope changes, start a fresh session.
1419
2. When you notice drift (conflicting goals, repeating mistakes, inventing APIs), stop and restart.
1520
3. Each loop must re-load the same stable stack (specs + rules) deterministically.
@@ -26,18 +31,30 @@ Load these documents in order before doing any implementation work:
2631
If you are unsure which spec applies, read `specs/00-vision-and-non-goals.md` and
2732
`specs/01-architecture-and-layering.md` first.
2833

34+
For deep architectural context, continue with:
35+
36+
5. `CONSTITUTION.md` — Agent constitution. Core values, positions on all 23 architectural decisions, authority hierarchy.
37+
6. `NEURON-REDESIGN-PLAN.md` — Authoritative plan. 6-layer architecture, workspace structure, phased implementation.
38+
7. `docs/architecture/HANDOFF.md` — Layer 0 implementation spec. Trait signatures, type definitions, module structure.
39+
8. `docs/architecture/composable-agentic-architecture.md` — Design rationale. 4 protocols + 2 interfaces, gap analysis.
40+
9. `docs/architecture/platform-scope-mapping.md` — Where features live (Neuron vs platform vs external infra).
41+
10. `docs/architecture/agentic-decision-map-v3.md` — Full design space. All 23 architectural decisions.
42+
11. `DEVELOPMENT-LOG.md` — Complete history of all decisions, research, and rationale.
43+
2944
## Where Truth Lives
3045

31-
1. Requirements and intended behavior live in `specs/`.
32-
2. Operational constraints (how we work, how to verify, how to avoid repeated failure modes)
46+
1. Architectural values and positions on the 23 decisions live in `CONSTITUTION.md`.
47+
2. Requirements and intended behavior live in `specs/`.
48+
3. Operational constraints (how we work, how to verify, how to avoid repeated failure modes)
3349
live in `rules/`.
34-
3. Deep rationale and history live in `docs/` and `DEVELOPMENT-LOG.md`.
50+
4. Deep rationale and history live in `docs/` and `DEVELOPMENT-LOG.md`.
3551

3652
If there is a conflict:
3753

38-
1. Specs override rules.
39-
2. Rules override ad-hoc agent behavior.
40-
3. If the specs are ambiguous, update the specs (do not invent behavior).
54+
1. Constitution overrides specs.
55+
2. Specs override rules.
56+
3. Rules override ad-hoc agent behavior.
57+
4. If the specs are ambiguous, update the specs (do not invent behavior).
4158

4259
## Backpressure (Verification Gates)
4360

@@ -46,11 +63,40 @@ This repo assumes Rust tooling is provided by Nix. Do not assume `cargo` exists
4663
Use these commands as your default backpressure:
4764

4865
1. Format: `nix develop -c nix fmt`
49-
2. Tests: `nix develop -c cargo test --workspace --all-targets`
50-
3. Lints: `nix develop -c cargo clippy --workspace --all-targets -- -D warnings`
66+
2. Build: `nix develop -c cargo build --workspace`
67+
3. Tests: `nix develop -c cargo test --workspace --all-targets`
68+
4. Lints: `nix develop -c cargo clippy --workspace --all-targets -- -D warnings`
69+
5. Docs: `nix develop -c cargo doc --no-deps`
70+
71+
All must pass before any commit. For layer0 test-utils features:
72+
73+
```bash
74+
nix develop -c cargo test --features test-utils -p layer0
75+
```
5176

5277
Do not claim "done" unless you have fresh evidence from the relevant command(s) for the change.
5378

79+
## Project Rules
80+
81+
### Do
82+
83+
- Follow `NEURON-REDESIGN-PLAN.md` for all structural decisions
84+
- Match layer0 trait signatures exactly — they are the stability contract
85+
- Use `#[deny(missing_docs)]` on every public item
86+
- Test that every message type round-trips through serde_json
87+
- Test that every trait is object-safe (`Box<dyn Trait>` compiles and is `Send + Sync`)
88+
- Keep layer0 dependencies minimal (serde, async-trait, thiserror, rust_decimal — that's it)
89+
- Update `DEVELOPMENT-LOG.md` after each phase
90+
91+
### Do Not
92+
93+
- Add dependencies to layer0 beyond what's already there
94+
- Add methods to layer0 protocol traits beyond what `HANDOFF.md` defines
95+
- Change layer0's trait signatures — they are the stability contract
96+
- Make layer0 traits non-object-safe
97+
- Skip phases — the phased approach is sequential
98+
- Make undocumented decisions — update the plan first if deviating
99+
54100
## TDD Policy
55101

56102
When feasible:
@@ -65,6 +111,65 @@ Exceptions are allowed only for:
65111
2. Pure documentation changes.
66112
3. Configuration-only changes where tests are not meaningful (but verification is still required).
67113

114+
## Architecture Principles
115+
116+
### Layer 0 Protocol
117+
118+
- Protocol only: object-safe traits + serde wire types. No execution policy, no technology bindings, no durability semantics.
119+
- Additive changes preferred; breaking changes planned and versioned.
120+
121+
### Effects Boundary
122+
123+
- Sacred: operators declare, orchestrators/environments execute. No direct writes from operators.
124+
125+
### Hooks vs Steering
126+
127+
- **Hooks**: event-triggered observation/intervention at defined points (pre/post inference/tool, exit) with explicit actions (Halt/Skip/Modify). For policy/observability/redaction, not control flow.
128+
- **Steering**: operator-initiated control flow. Runtime decides when to poll, may inject messages, may skip current batches. Keep steering out of hooks.
129+
130+
### Execution Mechanics (explicit, opt-in)
131+
132+
- ToolExecutionStrategy (default: sequential). Optional barrier scheduling with Shared/Exclusive + batch flush + parallel shared tools.
133+
- SteeringSource polled at defined boundaries to inject mid-loop messages and optionally skip remaining tools.
134+
- Optional streaming tool API; forward chunks via ToolExecutionUpdate hook point. Streaming is observation-only; must not alter control flow.
135+
136+
### Defaults
137+
138+
- Slim for simple use cases. Advanced behavior opt-in via small, composable traits. No boolean soup.
139+
140+
### Turn Engine Decomposition
141+
142+
Prefer composing these primitives over monolithic loops:
143+
ContextAssembler, ToolExecutionPlanner, ConcurrencyDecider, BatchExecutor, SteeringSource, HookDispatcher, EffectSynthesizer, ExitController.
144+
145+
### Tool Metadata
146+
147+
- Source of truth for concurrency: Shared/Exclusive hints live on tool definition. Deciders read metadata first, may layer policy.
148+
149+
### Limits
150+
151+
- Single authority: budget/time/turns live in ExitController. Planners observe remaining budget/time (read-only).
152+
153+
### Local vs Durable
154+
155+
- LocalEffectExecutor: lean, in-order, best-effort.
156+
- Durable semantics (idempotency keys, retries, sagas) belong to durable orchestrators, not Layer 0 or local executors.
157+
- Orchestrator owns the reference effect interpreter and minimal signal/query semantics (local first, durable later).
158+
159+
### Credentials
160+
161+
- Resolved/injected via Environment + secret/auth/crypto backends. Tests must prove no secret leakage.
162+
163+
### Invariants
164+
165+
- Preserve tool_use → tool_result pairing; on steering, emit placeholders for skipped tools.
166+
- Refactor guardrail: behavior-preserving refactors must pass full test suite before adding new capabilities via decomposed traits.
167+
168+
### Conformance
169+
170+
- Golden tests prove provider swap, state swap, operator swap, and orchestration compose deterministically.
171+
- Enforce CI backpressure (fmt, clippy -D warnings, tests).
172+
68173
## Codifying Learnings (Build Your Stdlib)
69174

70175
When a failure mode repeats or an agent needs steering:
@@ -76,47 +181,9 @@ When a failure mode repeats or an agent needs steering:
76181

77182
Goal: make the correct outcome the path of least resistance.
78183

79-
## Related Documents
80-
81-
This repo already includes a deeper, Neuron-specific project guide in `CLAUDE.md`. Agents should
82-
consult it after the spec/rules stack when doing any substantial work.
83-
84184
## Loop Files
85185

86186
This repo is designed to be run in a deterministic loop:
87187

88188
1. `PROMPT.md` is the loop prompt.
89189
2. `ralph_queue.md` is the single prioritized queue.
90-
91-
92-
## Composability Philosophy (Neuron v2)
93-
94-
- Layer 0 must stay stable: object-safe traits + serde wire types. Additive changes preferred; breaking changes are planned and versioned.
95-
- Effects are the side‑effect boundary: operators declare, orchestrators/environments execute. No direct writes from operators.
96-
- Hooks are for policy/observability/redaction, not control flow. Halt/Skip/Modify are explicit; do not encode scheduling in hooks.
97-
- Execution mechanics are explicit and opt‑in:
98-
- ToolExecutionStrategy (default: sequential). Optional barrier scheduling with Shared/Exclusive + batch flush + parallel shared tools.
99-
- SteeringSource polled at defined boundaries to inject mid‑loop messages and optionally skip remaining tools.
100-
- Optional streaming tool API; forward chunks via a ToolExecutionUpdate hook point.
101-
- Defaults must remain slim for simple use cases. Advanced behavior is opt‑in and modular; avoid boolean soup.
102-
- Orchestrator owns the reference effect interpreter and minimal signal/query semantics (local first, durable later).
103-
- Credentials are resolved/injected via Environment + secret/auth/crypto backends; tests must prove no secret leakage.
104-
- Conformance: golden tests prove provider swap, state swap, operator swap, and orchestration compose deterministically.
105-
106-
## Architecture Principles (Execution + Composability)
107-
108-
- Layer 0 is protocol only: object-safe traits + serde wire types. No execution policy, no technology bindings, no durability semantics.
109-
- Effects boundary is sacred: operators declare; orchestrators/environments execute. Operators must not write state directly.
110-
- Hooks vs Steering:
111-
- Hooks are event-triggered observation/intervention at defined points (pre/post inference/tool, exit) with explicit actions.
112-
- Steering is operator-initiated control flow: the runtime decides when to poll, may inject messages, and may skip current batches. Keep steering out of hooks.
113-
- Defaults stay slim: sequential tools, no steering, no streaming, local best-effort effects. Advanced behavior is opt-in via small, composable traits (no boolean soup).
114-
- Turn engine decomposition: prefer composing these primitives over monolithic loops:
115-
- ContextAssembler, ToolExecutionPlanner, ConcurrencyDecider, BatchExecutor, SteeringSource, HookDispatcher, EffectSynthesizer, ExitController.
116-
- Tool metadata is source of truth: concurrency hints (Shared/Exclusive) live on the tool definition; deciders read metadata first and may layer policy.
117-
- Single authority for limits: budget/time/turns live in ExitController; planners only observe remaining budget/time (read-only).
118-
- Local vs durable: keep LocalEffectExecutor lean (in-order, best-effort). Durable semantics (idempotency keys, retries, sagas) belong to durable orchestrators, not Layer 0 or local executors.
119-
- Streaming is observation-only: ToolExecutionUpdate is read-only; it must not alter control flow.
120-
- Invariants: preserve tool_use → tool_result pairing; on steering, emit placeholders for skipped tools.
121-
- Refactor guardrail: behavior-preserving refactors must pass the full test suite before adding new capabilities via decomposed traits.
122-
- Conformance: prove composition patterns (provider/state/operator/orchestration swaps) with golden tests; enforce CI backpressure (fmt, clippy -D warnings, tests).

CLAUDE.md

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1 @@
1-
# CLAUDE.md
2-
3-
## What This Project Is
4-
5-
Neuron is a Rust workspace implementing a 6-layer composable agentic AI architecture. Layer 0 (`layer0` crate) defines the stability contract — four protocol traits (Turn, Orchestrator, StateStore, Environment), two cross-cutting interfaces (Hook, Lifecycle events), and the message types that cross every boundary. Layers 1-5 build implementations on top.
6-
7-
## Required Reading
8-
9-
Before doing ANY work, read these documents IN ORDER:
10-
11-
1. **NEURON-REDESIGN-PLAN.md** — The authoritative plan for the workspace redesign. 6-layer architecture, workspace structure, design decisions, phased implementation.
12-
2. **docs/architecture/HANDOFF.md** — Layer 0 implementation spec. Trait signatures, type definitions, module structure, layer definitions.
13-
3. **docs/architecture/composable-agentic-architecture.md** — Design rationale. 4 protocols + 2 interfaces, gap analysis, coverage map.
14-
4. **docs/architecture/platform-scope-mapping.md** — Where features live (Neuron vs platform vs external infra).
15-
5. **docs/architecture/agentic-decision-map-v3.md** — Full design space. All 23 architectural decisions.
16-
6. **DEVELOPMENT-LOG.md** — Complete history of all decisions, research, and rationale across all sessions.
17-
18-
## Build & Test
19-
20-
```bash
21-
cargo build
22-
cargo test
23-
cargo clippy -- -D warnings
24-
cargo doc --no-deps
25-
```
26-
27-
All four must pass before any commit. For layer0 test-utils features:
28-
29-
```bash
30-
cargo test --features test-utils -p layer0
31-
```
32-
33-
## Rules
34-
35-
### Do
36-
- Follow NEURON-REDESIGN-PLAN.md for all structural decisions
37-
- Match layer0 trait signatures exactly — they are the stability contract
38-
- Use `#[deny(missing_docs)]` on every public item
39-
- Test that every message type round-trips through serde_json
40-
- Test that every trait is object-safe (Box<dyn Trait> compiles and is Send + Sync)
41-
- Keep layer0 dependencies minimal (serde, async-trait, thiserror, rust_decimal — that's it)
42-
- Update DEVELOPMENT-LOG.md after each phase
43-
44-
### Do Not
45-
- Add dependencies to layer0 beyond what's already there
46-
- Add methods to layer0 protocol traits beyond what HANDOFF.md defines
47-
- Change layer0's trait signatures — they are the stability contract
48-
- Make layer0 traits non-object-safe
49-
- Skip phases — the phased approach is sequential
50-
- Make undocumented decisions — update the plan first if deviating
1+
See [AGENTS.md](./AGENTS.md).

0 commit comments

Comments
 (0)