---
name: au-sys-ops-bootstrap
description: Execute SESSION_BOOTSTRAP — load all .agents canonical files, process all GATE_{{ref_id}} blocks, run ai-agent --help for namespace listing, verify CDR paths, and echo identity fields. Use when starting a new session, /bootstrap, run bootstrap, load doctrine, initialize agent.
license: MIT
compatibility: opencode
metadata:
  workflow: session-bootstrap
  trigger: /bootstrap
disable-model-invocation: true
---

YOU_MUST: Resolve all `ALL_CAPS` directive keys (single-word or compound, followed by `:`) in this file as AiDSL `COMPOUND_INSTRUCTION_VERB`s. Resolution rules: (1) use targeted grep/line search of `.agents/au-sys/aidsl/AGENTS_AI_DSL.yaml` only — full file read is FORBIDDEN; (2) do NOT guess verb meanings; (3) HALT and report on any unresolvable token.


UNDERSTAND_AND_ACKNOWLEDGE:
  - ./AGENTS.md
  - ./AGENTS_DOCTRINE.yaml
  - ./AGENTS_CONTRACT.yaml
  - ./AGENTS_DIRECTIVES.yaml
PURPOSE: "MANDATORY authoritative bootstrap load, gate processing, and formal acknowledgement of all directives in the specified files before any action."
THEN:
  PROCESS_GATES_IN_ORDER: true
  ACKNOWLEDGE_DOCTRINE: true
  ACKNOWLEDGE_CONTRACT: true
  ACKNOWLEDGE_DIRECTIVES: true
  ECHO_BOOTSTRAP_OUTPUT: true
  RUN_CONTROL:
    CONTINUE: true
    HALT_ON_ERROR: true

ORDERS:
  RTFM:
    "Read the specified files in full, acknowledge understanding and acceptance of all directives, and execute the mandatory bootstrap sequence as defined in the directives and the authoritative bootstrap script."
  CODEBASE_STANDARDS_INDEX: C:\AustralisSystems\agentic_code_engine\packages\ai_agent\src\au_sys_ai_agent\docs\architecture\architecture_bluprints\federated_services_platform\compendium\FSP_000_Compendium_Index.md
  THEN:
    CONTINUE: true

# SESSION_BOOTSTRAP

Execute the full bootstrap sequence as defined in `DMOD.PILLARS.DMOD-P07` and `OPR.PROTOCOLS.OPR-BOOTSTRAP`.

## MANDATORY SEQUENCE

**STEP-01** — Load and parse the authoritative directive files:
`READ_AND_ACKNOWLEDGE:`
- `./AGENTS.md`
- `./AGENTS_DIRECTIVES.yaml`
- `./AGENTS_DOMAIN.yaml`
- `./AGENTS_DOMAIN.schema.json`

**STEP-01.5** — Validate ai-agent CLI entrypoint:
`EXECUTE: ai-agent --help`
Optional secondary metadata check: `EXECUTE: ai-agent --info` (supplementary only; not namespace listing).

**STEP-01.6** — Execute authoritative bootstrap script:
`EXECUTE_COMMAND: python .agents/scripts/session_bootstrap.py`

The script is the authoritative source for bootstrap pass/fail and bootstrap output fields.
The script MUST validate bootstrap mechanics only: canonical file path resolution and availability, runtime identity fields, `ai-agent --help` (namespace listing), `ace list`, CDR path integrity, idempotent `.agents` sync into `packages/ai_agent/src/au_sys_ai_agent/libs/.agentic_code_engine/.agents`, and root AGENTS mirror sync.
The script MUST NOT be treated as a substitute for the agent reading, acknowledging, interpreting, or maintaining doctrine, directives, contract, oath, gate, or AiDSL content in session context.
If `session_bootstrap.py` produces unexpected output or errors, log the full output and halt with an error message.

**STEP-02** — Agent processes all 16 GATE blocks from AOD in document order after reading the authoritative files into its own context:
`PROCESS_GATES_IN_ORDER: GATE_LOAD_001 -> GATE_RFC_001 -> GATE_IIL_001 -> GATE_ARCH_001 -> GATE_CPD_001 -> GATE_CDP_001 -> GATE_CDE_001 -> GATE_CID_001 -> GATE_CSD_001 -> GATE_MCP_001 -> GATE_000 -> GATE_001 -> GATE_SKL_001 -> GATE_002 -> GATE_SES_001 -> GATE_TED_001` (halt immediately on any gate failure; do not skip ahead)

**STEP-03** — Agent commits to every directive acknowledgement after reading the governing files:
`ACKNOWLEDGE_ALL_DIRECTIVES: all UNDERSTAND_AND_ACKNOWLEDGE commitments`

**STEP-04** — Respond using script output only:
Echo bootstrap fields from `session_bootstrap.py` console output:
- `ROOT_PATH`
- `CODEBASE_DIR`
- `AGENTIC_CODE_ENGINE_DIR`
- `SESSION_ID`
- `HOST`
- `COMMANDER`
- `USER`

FORBIDDEN:
- Running ad-hoc bootstrap validation commands after `session_bootstrap.py`
- Running ad-hoc identity commands after `session_bootstrap.py`
- Reporting bootstrap values that are not sourced from `session_bootstrap.py` output

**FAIL-CLOSED RULE:** If ANY step fails, HALT immediately and report the failure.
Do NOT proceed past a failed step.
