interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / REPOSITORY_EXECUTION_RULES.md

205 lines · 10771 bytes Raw Blame History Source

AIEN Repository Execution Rules

Adoption

Adopted 2026-10-10 from Drake's revised rules for the six-issue campaign (interplane#97 and #98, aien-sovereign-core#397 and #398, aegis-runtime#38 and #39). Tooling: scripts/pr-gate.sh and scripts/rebase-crumb.sh.

Recorded facts (2026-10-10)

These rules apply to Claude Code, all delegated workers, and all repositories involved in this implementation campaign.

The objective is to ship verified code without corrupting shared branches, bypassing security requirements, or creating unnecessary integration conflicts.

1. Source of Truth

GitHub main is authoritative. Inspect current code, tests, active PRs, and repository instructions before editing.

Never implement an issue solely from its description. Check whether the functionality already exists or has been superseded.

Use separate branches and worktrees for concurrent development.

One worker owns each writable worktree. Never allow two workers to modify the same worktree concurrently.

2. Crumb Compilation

Retired (DRA-97, 2026-11-07: "Retire Crumbs from the active workflow while preserving live ownership"). A PR needs no crumb compile, no crumb verify and no separate crumb commit; existing .crumb files stay as history. The rule as it stood:

Every applicable PR must have .crumb compilation and verification completed after its final source change.

Required commands: crumb compile . then crumb verify .

Commit generated .crumb changes separately as the final commit.

Do not modify source files after that commit without rerunning compilation and verification.

If a repository does not support these commands, report the discrepancy and follow its explicit repository policy. Never silently skip a required check.

2a. Local verification

scripts/pr-gate.sh reads GitHub's CLEAN state. It does not prove the commit was verified. The local admission check that complements CLEAN is aien-test verify COMMIT (sovereign-core tools/aien-test, ADR 0033 amendment 2026-10-11): it prints READY when every gate required at the base ref has a PASS receipt for that exact commit, and BLOCKED otherwise, with the reason (a missing or NOT_RUN gate, an UNMAPPED changed path, or a BLOCKED_OPERATOR head). Run it on the final SHA. Since the retirement (DRA-97, 2026-11-07) the final SHA is the last source commit: there is no crumb commit, and READY no longer depends on crumbs being CURRENT (sovereign-core tools/aien-test/docs/LOCAL_VERIFICATION.md). Before the retirement it was the commit that included the crumb commit, and a pre-crumb SHA was never READY (docs/crumbs/LOCAL_PIPELINE.md section 2, history).

Trust anchors come from the base ref, never from the head under test (ADR 0033 amendment, A1): the required gate set, .aien/verify.pub, .aien/always and .aien/unmapped-ok are read from origin/main. A head that changes the pipeline's own configuration (.aien/, tests/gates/, .github/workflows/, .forgejo/, tools/aien-test/) is BLOCKED_OPERATOR: the operator runs its verification by hand and says so in the PR. Acceptance proofs for the crumb side of this rule (determinism, fixed point, staleness, claims) are scripts/pipeline-proofs/13-*.sh to 18-*.sh; measured numbers in scripts/pipeline-proofs/RESULTS-2026-10-11.md. Since the retirement (DRA-97, 2026-11-07) proofs 19-*.sh to 21-*.sh prove the opposite: pr-gate.sh admits stale, missing or mixed crumbs with GATE crumb: SKIP retired, rebase-crumb.sh runs no crumb tool and adds no crumb commit, and the final SHA is the last source commit.

3. Rebase and Crumb Conflicts

Every sovereign-core merge to main can invalidate .crumb files in other open PRs.

After each sovereign-core merge, evaluate remaining PRs for drift.

Approved recovery script: scripts/rebase-crumb.sh <worktree> <branch> (this repository).

Before running it:

The script takes main's .crumb when a conflict is only in .crumb files, and pushes with lease. Since the crumb retirement (DRA-97, 2026-11-07) it no longer runs crumb compile or crumb verify and adds no crumb commit.

If it reports CODE CONFLICT, stop automated rebasing for that branch. Resolve the source conflict by hand.

Never discard source changes to manufacture a clean rebase.

Do not rewrite another worker's branch without coordination.

4. Definition of CLEAN

A PR may merge only when all of the following hold:

Do not equate GitHub's CLEAN merge-state label with complete verification.

5. Merge Procedure

Serialize merges into each repository's main branch.

Default command: gh pr merge N -R aien-dev/<repo> --squash --delete-branch

Only use --admin when explicitly authorized for that specific PR and when the required project governance permits it.

Never use administrative privileges to hide failing tests, missing approvals, security findings, or unresolved conflicts.

After every merge, refresh main and revalidate dependent or competing PRs.

6. GitHub PR Editing

The normal gh pr edit workflow is currently unreliable in this environment.

Use the API fallback: gh api -X PATCH repos/aien-dev/<repo>/pulls/N -F body=@file

Verify the returned response and fetch the PR afterward to confirm the update.

Do not assume an API operation succeeded merely because the command exited.

7. Language and Runtime Constraints

No Python or systemd may be introduced as part of this campaign.

Use Rust for AIEN-owned runtime, orchestration, adapters, and execution control.

Motus may run externally using its own dependencies, but the AIEN integration must communicate over an explicitly verified protocol boundary.

If a task requires Python inside an AIEN-owned repository, treat it as an architectural conflict. Redesign it or report the blocker before proceeding.

Existing Python files do not authorize adding more Python. Flag any conflict with the strict repository policy rather than silently ignoring it.

8. Command Hooks

A local Bash hook rejects certain command text containing accelerator or kernel-module related terms.

Do not embed source-file contents containing these terms into Bash commands or heredocs. Use the approved Write tool for file creation and editing.

Do not attempt to bypass restrictions on executing prohibited operations.

If an approved development command is incorrectly blocked, report the exact failure and use an authorized alternative.

9. Commits and Attribution

Use small, logically isolated commits.

Required commit trailers, when attribution accurately reflects the contributors:

Co-authored-by: Drake Stapleton <drake@aienos.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Do not invent contributors or misrepresent authorship.

Required PR footer: 🤖 Generated with Claude Code

Every PR must reference its issue, describe its implementation, identify verification performed, and disclose limitations.

10. Worker Models and Verification

Use Sonnet for delegated implementation workers unless instructed otherwise.

Workers may inspect, implement, test, and propose solutions within their assigned ownership boundaries.

A worker's claim of completion is not verification.

The coordinating agent must independently inspect every worker's changes and verify relevant tests, security invariants, and actual GitHub state.

Do not accept unsupported claims about test passes, hardware performance, successful merges, or completed integrations.

Use an independent reviewer for security-sensitive changes.

11. Failure Handling

Do not repeatedly retry the same failing operation without identifying the cause.

On failure:

  1. Capture the exact failure and affected commit.
  2. Determine whether it is source-related, environmental, or caused by concurrent changes.
  3. Apply the smallest justified correction.
  4. Rerun the affected verification.
  5. Escalate or isolate persistent blockers without destroying valid work.

Never force-push another worker's changes away.

Never turn off tests, security checks, or authorization rules merely to make a PR merge.

12. Communication

Use plain English when reporting to Drake. Do not use em dashes or en dashes.

Provide concise updates that identify completed work, active work, blockers, and next actions.

Do not confuse attempted operations with completed operations.

13. Final Delivery

Before declaring the campaign complete:

A task is complete only when the implementation, verification, and required integration are finished.

14. Worker Instructions

Worker briefs live with each campaign; this document wins when they conflict.

Stable rules and validated scripts live in aien-architecture (docs/REPOSITORY_EXECUTION_RULES.md, scripts/pr-gate.sh, scripts/rebase-crumb.sh).

Operating principle: Ship correct, verified code. Preserve other workers' changes. Protect main. Never trade correctness for apparent progress.