Agent Contract: Repository Execution Policy

This file is the execution contract for this repository.

Queue Resolution Policy (Linear-first)

Before starting implementation, resolve task pickup in this order:

  1. Linear first: confirm issue state, dependencies, acceptance criteria, and gate type.
    • Before any repo edits, set the Linear issue state to In Progress.
    • Before any repo edits, ensure the issue is linked to the active execution cycle.
    • If either action fails, stop execution and report the blocker.
  2. Local second: corroborate with docs/tasks/CWS-<id>.md and docs/agent-context.md.
  3. If Linear and local context diverge, report drift in the Linear issue before execution.

No implementation starts until pickup drift is documented.

Agent-context memory rule:

Agent Identity And Boundary Model

Identity and orchestration are defined in the canonical docs. This file enforces operational boundaries using explicit MUST NOT rules.

Role boundaries:

Global boundary rules:

Two-Phase Orchestration Guardrail

Use a Two-Phase model:

  1. Plan phase: produce an execution plan with scope, lanes, and validation gates.
  2. Execute phase: run only after the plan is approved/confirmed in task context.

Orchestrators MUST NOT collapse planning and execution into one uncontrolled pass for multi-step work.

Clarification Protocol

Before execution, perform structured clarification checks:

Ask one clarification at a time. Do not ask routine questions already answered by this file, repo skills, or task context.

Loop And Stuck-Agent Safety

Agents MUST NOT continue blind retries after the stop threshold.

DoR And DoD Contract

DoR gate before pickup:

DoD gate before closeout:

Reference canonical definitions in docs/master-plan.md and docs/sop.md.

Task-File Convention

Workflow And Validation Gates

Use repository entry points instead of ad hoc command sequences:

Graphite and GitHub CLI policy:

Code quality principles — these are hard requirements, not suggestions:

Session Chronicle

Instruction-Based Boundary Caveat

Agent boundary control is instruction-based, not hard sandbox partitioning per role.

Review Policy

For PR reviews, prioritize high-impact findings:

If there are no significant issues, state: No high-impact findings.

Official Docs And Skills Policy

Platform Applicability

This contract applies to all agent execution platforms used with this repository, including OpenAI Codex and Anthropic Claude Code. Platform-specific mechanics are documented in:

The rules in this file override any platform-specific defaults.

Label Taxonomy

Approved labels (15). Do not create new labels without human approval.

Label Purpose
Spec Has written specification
Ready Pickup-ready, no blockers
agent-task Work to be executed by an AI agent
human-task Human executes
Infra Infrastructure/tooling domain
Workflow Process/workflow domain
epic:dx-setup DX setup epic
epic:editorial-qa Editorial quality epic
epic:ci-pipeline CI pipeline epic
epic:safety Safety and security epic
epic:skills Skill authoring epic
epic:reasoning Reasoning skills epic
epic:slack Slack integration epic
epic:dispatch Dispatch workflow epic
epic:agents-config Agent config epic

Label consolidation reference (CWS-93): epic:security was absorbed into epic:safety. Status:* labels, duplicate Bug/Feature labels, and Codex-specific labels were removed. If old label names appear in Linear history, map them to the closest approved label above.

Bash Security Baseline

Shell scripts must: