This file defines the agent workflow contract for this repository.
Build and operate aiOS as a safe, event-native, session-oriented agent operating system in Rust.
- Preserve crate dependency direction:
aios-modelis foundational and side-effect free.- Higher layers must depend downward only.
- Avoid cycles and "shortcut" imports across layers.
- Route side effects through controlled boundaries:
- Tool execution flows through
aios-tools+aios-sandbox. - Session state changes flow through
aios-runtime. - Avoid hidden mutable state outside workspace files and event logs.
- Keep event provenance and auditability intact:
- Emit events for meaningful transitions.
- Preserve monotonic sequence per session.
- Preserve monotonic sequence per branch.
- Keep artifacts traceable to event history.
- Enforce branch lifecycle invariants (bounded fork sequence, merged branches read-only,
mainnot used as merge source).
- Enforce quality gate before completion:
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacescripts/validate_openapi_live.sh
- Update docs with behavior changes:
- Update
README.mdfor user-facing changes. - Update
docs/ARCHITECTURE.mdfor structural or model changes. - Update relevant
context/files for workflow changes.
- Prefer additive, test-backed changes:
- Add or extend tests with every behavioral change.
- Do not silently widen capabilities or safety boundaries.
Read these first for non-trivial tasks:
context/01-current-state.mdcontext/02-engineering-rules.mdcontext/03-agent-workflows.mdcontext/04-release-readiness.md
Use these repo-local skills when their trigger conditions match:
skills/kernel-evolution/SKILL.md
- Use when changing core kernel behavior, event schema, capabilities, runtime lifecycle, checkpoints, or memory provenance.
skills/control-plane-api/SKILL.md
- Use when adding or modifying API endpoints, request/response contracts, SSE streaming, or approval APIs.
skills/release-readiness/SKILL.md
- Use when preparing production rollout, CI/CD hardening, packaging, observability, security controls, or distribution.
- Load relevant
context/andskills/files. - Define scope and invariants.
- Implement changes in smallest coherent increments.
- Add/adjust tests.
- Run quality gate.
- Summarize outcomes, risks, and next steps.
- Extract lessons from completed tasks and write concise entries in
docs/INSIGHTS.md. - Convert repeated workflows into reusable instructions by updating files in
skills/. - Promote stable project knowledge into
context/files to reduce repeated rediscovery. - Revisit assumptions after failures/incidents and record corrected guidance.
- Update
AGENTS.mdwhen architecture, workflow, quality policy, or safety boundaries change. - Update
AGENTS.mdin the same change-set as the behavior change (do not defer). - Keep guidance minimal, actionable, and aligned with actual repository reality.
- Treat stale AGENTS instructions as defects and fix immediately.
- Use
tracingfor runtime observability. - Prefer deterministic file paths under session workspace.
- Keep policy default-deny for sensitive actions.
- Keep public APIs version-aware and backward compatible unless explicitly changing contracts.