#!/usr/bin/env bash set -euo pipefail # Run from any directory. The executable argument must be an absolute native path. aie_binary=${1:?Usage: native-smoke.sh /absolute/path/to/ai-engineering} aie_source_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P) aie_fixture=$(mktemp -d "${TMPDIR:-/tmp}/ai-engineering-smoke.XXXXXX") if [[ "${AIE_KEEP_FIXTURE:-0}" != 1 ]]; then trap 'rm -rf "$aie_fixture"' EXIT; fi cd "$aie_fixture" "$aie_binary" --help > help.txt "$aie_binary" --version > version.txt grep -q 'ai-engineering 0.1.0' version.txt if "$aie_binary" --unknown > invalid.txt 2>&1; then echo 'Invalid arguments unexpectedly succeeded' >&2 exit 1 else test "$?" -eq 2 fi aie_without_git() { PATH="$aie_fixture/no-installed-tools" "$aie_binary" "$@" } # A source folder is a complete engineering project, even with no Git installed. mkdir plain cd plain printf 'Existing source\n' > main.txt aie_without_git init --name 'Simple Project' > init.yaml aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Continue application' --goal 'Preserve local context' > work.yaml aie_without_git work list --open --format table > works-table.txt grep -q 'WRK-0001' works-table.txt grep -q '0/0' works-table.txt aie_without_git work list --open --format csv > works.csv grep -q '^id,title,status,archived,steps,pending_actions,validation,next_action' works.csv grep -q '^WRK-0001,Continue application,OPEN,false,0/0,' works.csv aie_without_git work list --format markdown > works.md grep -Fq '| ID | Title | Status |' works.md aie_without_git status --format table > status-table.txt grep -q 'Compatibility: CURRENT' status-table.txt aie_without_git status --format csv > status.csv cmp works.csv status.csv aie_without_git next-actions --format table > actions-table.txt grep -q 'REFINE_SCOPE' actions-table.txt aie_without_git next-actions WRK-0001 --format csv > actions.csv grep -q '^work_id,code,message,command' actions.csv grep -q '^WRK-0001,CREATE_PLAN,' actions.csv aie_without_git project compatibility --format json > compatibility.json grep -q '"state" : "CURRENT"' compatibility.json grep -q '"migrationRequired" : false' compatibility.json grep -q '"protocolVersion": 3' .ai-engineering/protocol.json cp .ai-engineering/protocol.json baseline-protocol.json sed 's/"protocolVersion": 3/"protocolVersion": 99/' baseline-protocol.json > .ai-engineering/protocol.json cp .ai-engineering/protocol.json future-protocol.json if aie_without_git project compatibility --format json > future-compatibility.json; then echo 'Unsupported contract unexpectedly succeeded' >&2 exit 1 else test "$?" -eq 4 fi grep -q '"state" : "UNSUPPORTED"' future-compatibility.json if aie_without_git onboard > refused-onboard.txt 2>&1; then echo 'A newer contract was silently overwritten' >&2 exit 1 else test "$?" -eq 4 fi cmp future-protocol.json .ai-engineering/protocol.json cp baseline-protocol.json .ai-engineering/protocol.json printf '%s' 'No repository is required' > proposal.md aie_without_git discussion add WRK-0001 --text-file proposal.md > discussion.md aie_without_git artifact add WRK-0001 --file main.txt --purpose 'Initial source evidence' > artifact.yaml aie_without_git decision draft WRK-0001 --title 'Pilot the protocol' --evidence ART-0001 > decision.yaml aie_without_git work update WRK-0001 --goal 'Refined local scope' --constraint 'Keep existing source' \ --acceptance 'Context reloads in another process' --format json > updated-work.json grep -q 'Refined local scope' updated-work.json grep -q 'DSC-0001' updated-work.json grep -q 'DEC-0001' updated-work.json grep -q 'ART-0001' updated-work.json cp .ai-engineering/works/WRK-0001-continue-application/work.md before-noop.md aie_without_git work update WRK-0001 --goal 'Refined local scope' > repeated-update.yaml cmp before-noop.md .ai-engineering/works/WRK-0001-continue-application/work.md # Exercise compatibility/migration using an exact legacy representation of this entry. aie_discussion=.ai-engineering/works/WRK-0001-continue-application/discussions/DSC-0001.md grep -q 'documentVersion: 2' "$aie_discussion" awk ' /^---$/ { delimiters++; if (delimiters == 2) { print "text: \"No repository is required\""; print "---"; exit } } /documentVersion:/ { next } { print } ' "$aie_discussion" > legacy.md cp legacy.md "$aie_discussion" cp "$aie_discussion" before-compatibility.md aie_without_git project compatibility --format json > legacy-compatibility.json grep -q '"state" : "LEGACY_COMPATIBLE"' legacy-compatibility.json grep -q '"readable" : true' legacy-compatibility.json cmp before-compatibility.md "$aie_discussion" aie_without_git work context WRK-0001 --format json > before.json aie_without_git discussion migrate WRK-0001 --format json > migration.json grep -q '"converted" : 1' migration.json grep -q 'documentVersion: 2' "$aie_discussion" aie_without_git discussion migrate WRK-0001 --format json > repeated-migration.json grep -q '"converted" : 0' repeated-migration.json mkdir src cd src aie_without_git work context WRK-0001 --format json > ../after.json cd .. cmp before.json after.json aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json test ! -e .git cd "$aie_fixture" # Creating a Plan promotes a draft without a model or direct human attestation. mkdir plan-promotion cd plan-promotion aie_without_git init --name 'Plan Promotion' > init.yaml aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Promote decision' > work.yaml aie_without_git decision draft WRK-0001 --title 'Chosen approach' --context 'Problem' \ --approach 'Small implementation' --rationale 'Bounded scope' > draft.yaml aie_without_git plan create WRK-0001 --title 'Delivery' --decision DEC-0001 --author requester > plan.yaml aie_without_git decision show WRK-0001 DEC-0001 --format json > promoted.json grep -q '"approvalStatus" : "ACCEPTED"' promoted.json grep -q '"origin" : "SYSTEM_PLAN"' promoted.json grep -q '"humanApproved" : false' promoted.json grep -q '"planId" : "PLN-0001"' promoted.json aie_without_git decision history WRK-0001 DEC-0001 --format json > history.json grep -q '"approvalStatus" : "DRAFT"' history.json grep -q '"approvalStatus" : "ACCEPTED"' history.json cp .ai-engineering/works/WRK-0001-promote-decision/decisions/DEC-0001.md before-second-plan.md aie_without_git plan create WRK-0001 --title 'More delivery' --decision DEC-0001 > second-plan.yaml cmp before-second-plan.md .ai-engineering/works/WRK-0001-promote-decision/decisions/DEC-0001.md aie_without_git work context WRK-0001 --format markdown > context.md grep -q 'SYSTEM_PLAN' context.md aie_without_git project validate > validation.yaml aie_without_git project compatibility --format json > compatibility.json grep -q '"state" : "CURRENT"' compatibility.json cd "$aie_fixture" # DF import: independent sources, repeated IDs, reviewed preview and no-op retry. cp -R "$aie_source_root/src/test/resources/discussion-import/alpha" "$aie_fixture/df-alpha" cp -R "$aie_source_root/src/test/resources/discussion-import/beta" "$aie_fixture/df-beta" cp -R "$aie_fixture/df-alpha" "$aie_fixture/df-alpha-before" cp -R "$aie_fixture/df-beta" "$aie_fixture/df-beta-before" mkdir "$aie_fixture/df-import" cd "$aie_fixture/df-import" aie_without_git init --name 'DF import destination' > init.yaml aie_df_args=(--source "alpha=$aie_fixture/df-alpha" --source "beta=$aie_fixture/df-beta" --target alpha=runtime --target alpha=docs --target beta=studio --format json) aie_without_git import discussion "${aie_df_args[@]}" > preview.json grep -q '"action" : "CREATE"' preview.json grep -q '"action" : "SKIP"' preview.json aie_df_sha=$(sed -n 's/.*"fingerprint" : "\([a-f0-9]*\)".*/\1/p' preview.json) test "${#aie_df_sha}" -eq 64 aie_without_git import discussion "${aie_df_args[@]}" --apply --expect "$aie_df_sha" > applied.json grep -q '"applied" : true' applied.json aie_without_git work list --format json > imported-works.json test "$(grep -c '"id" : "WRK-' imported-works.json)" -eq 2 aie_without_git work context WRK-0001 --format json > imported-context.json grep -q 'café' imported-context.json grep -q 'runtime' imported-context.json cp -R .ai-engineering/works works-before aie_without_git import discussion "${aie_df_args[@]}" > repeat-preview.json aie_df_sha=$(sed -n 's/.*"fingerprint" : "\([a-f0-9]*\)".*/\1/p' repeat-preview.json) grep -q '"action" : "UNCHANGED"' repeat-preview.json aie_without_git import discussion "${aie_df_args[@]}" --apply --expect "$aie_df_sha" > repeated.json diff -r works-before .ai-engineering/works diff -r "$aie_fixture/df-alpha-before" "$aie_fixture/df-alpha" diff -r "$aie_fixture/df-beta-before" "$aie_fixture/df-beta" aie_without_git project validate > import-validation.yaml aie_without_git project compatibility --format json > import-compatibility.json grep -q '"state" : "CURRENT"' import-compatibility.json echo 'Native DF import smoke passed (umbrella, open agendas, original content, preview, provenance and no-op reimport; no Git/JVM/models).' cd "$aie_fixture" # A single Git repository can contain both the source and protocol workspace. git init -q single cd single "$aie_binary" init --name 'Single Repository' > init.yaml "$aie_binary" repo add app --path . > repo.yaml "$aie_binary" work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Inspect application' --repo app > work.yaml "$aie_binary" work context WRK-0001 --format json > before.json mkdir src cd src "$aie_binary" work context WRK-0001 --format json > ../after.json cd .. cmp before.json after.json grep -q '"repositoryId" : "app"' after.json "$aie_binary" project validate --format json > validation.json grep -q '"valid" : true' validation.json cd "$aie_fixture" echo 'Native simple-project continuity smoke passed (without Git and with one root repository).' # Work numbers are hexadecimal; child counters still use decimal. mkdir hexadecimal cd hexadecimal aie_without_git init --name 'Hexadecimal Works' > init.yaml for aie_number in {1..16}; do aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" "Work $aie_number" > "work-$aie_number.yaml" done grep -q 'id: "WRK-0009"' work-9.yaml grep -q 'id: "WRK-000A"' work-10.yaml grep -q 'id: "WRK-000F"' work-15.yaml grep -q 'id: "WRK-0010"' work-16.yaml grep -q 'lastWork: "0010"' .ai-engineering/works/.sequence.yaml aie_without_git discussion add WRK-000A --text 'Continue a hexadecimal Work' > discussion.md aie_without_git decision draft WRK-000A --title 'Hex Work draft' > decision.yaml aie_without_git work update WRK-000A --goal 'Hexadecimal continuity' > updated-work.yaml aie_without_git work context WRK-000A --format json > before.json mkdir src cd src aie_without_git work context WRK-000A --format json > ../after.json cd .. cmp before.json after.json aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json cd "$aie_fixture" # Reserve all old decimal spellings, including removed Works, when upgrading counters. mkdir legacy-counter cd legacy-counter aie_without_git init --name 'Legacy reservations' > init.yaml printf 'schemaVersion: 1\nlastWork: 16\n' > .ai-engineering/works/.sequence.yaml aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'After legacy reservation' > work.yaml grep -q 'id: "WRK-0017"' work.yaml grep -q 'schemaVersion: 2' .ai-engineering/works/.sequence.yaml aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json cd "$aie_fixture" echo 'Native hexadecimal Work identifiers and legacy reservations smoke passed.' # Exercise the refinement contract with two fixture adapters and fresh processes. mkdir refinement cd refinement aie_without_git init --name 'Refinement fixture' --general-adapter fixture-general \ --archive-policy reversible > init.yaml aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Compare ideas' > work.yaml printf 'Rendering: measure layers\nInput: compare controls\n' > ideas.md aie_without_git agent run WRK-0001 --task-file ideas.md --request-id ideas --requester fixture-human > refinement.md aie_without_git topic list WRK-0001 --format json > topics.json grep -q TOP-0002 topics.json aie_without_git next-actions WRK-0001 --format json > actions.json grep -q SVY-0001 actions.json printf '2\n' > answers.txt aie_without_git survey ask WRK-0001 SVY-0001 --input-file answers.txt --author fixture-human > guided.txt grep -q 'All pending questions answered' guided.txt aie_without_git survey answer WRK-0001 SVY-0001 QST-0001 \ --text 'Compare both approaches instead' --author fixture-human > revised-answer.yaml aie_without_git survey history WRK-0001 SVY-0001 --format json > survey-history.json grep -q ANS-0001 survey-history.json grep -q ANS-0002 survey-history.json printf 'Explicitly synthetic observation, not a game measurement\n' > fixture.txt aie_without_git artifact add WRK-0001 --file fixture.txt --purpose 'Synthetic contract evidence' > artifact.yaml aie_without_git agent configure --activity analyze --adapter fixture-reviewer > agents.yaml aie_without_git agent run WRK-0001 --task 'analyze: compare persisted proposals' \ --request-id analysis --requester fixture-agent > analysis.md grep -q fixture-reviewer analysis.md grep -q 'approvalStatus: "DRAFT"' .ai-engineering/works/WRK-0001-compare-ideas/decisions/DEC-0001.md cp .ai-engineering/works/WRK-0001-compare-ideas/work.md before-replay.md aie_without_git agent run WRK-0001 --task 'analyze: compare persisted proposals' \ --request-id analysis --requester fixture-agent > replay.md cmp analysis.md replay.md cmp before-replay.md .ai-engineering/works/WRK-0001-compare-ideas/work.md aie_without_git discussion restore WRK-0001 DSC-0002 --reason 'Reconsider fixture proposal' --by fixture-agent > restored.md aie_without_git agent run WRK-0001 --task 'summarize persisted results' --request-id summary > summary.md aie_without_git agent history WRK-0001 --format json > runs-before.json grep -q '"stale" : false' runs-before.json aie_without_git discussion add WRK-0001 --text 'New observation after summary' --author fixture-human > observation.md aie_without_git agent history WRK-0001 --format json > runs-after.json if grep -q '"stale" : false' runs-after.json; then echo 'Summary incorrectly remained fresh' >&2; exit 1; fi aie_without_git work context WRK-0001 --format json > before.json aie_without_git work context WRK-0001 --format markdown > before.md mkdir -p src/nested cd src/nested aie_without_git work context WRK-0001 --format json > ../../after.json aie_without_git work context WRK-0001 --format markdown > ../../after.md cd ../.. cmp before.json after.json cmp before.md after.md for aie_expected in TOP-0002 SVY-0001 ANS-0001 ANS-0002 DSP-0001 DSP-0002 RUN-0003 fixture-general fixture-reviewer; do grep -q "$aie_expected" after.json done aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json test ! -e .git cd "$aie_fixture" echo 'Native refinement smoke passed (topics, surveys, revised answers, two fixtures, dispositions, draft DEC, idempotency and staleness).' # Deterministic CLI protocol fixtures: exercise the native process runner without a JVM/model. mkdir -p providers local-cli cat > providers/codex <<'AIE_PROVIDER' #!/bin/sh provider=${0##*/} schema= reply= while [ "$#" -gt 0 ]; do case "$1" in --version) case "$provider" in codex) printf 'codex-cli 0.169.0\n';; *) printf '2.1.311 (Claude Code)\n';; esac exit 0;; --help) printf '%s\n' '--output-schema --output-last-message --ignore-user-config --ephemeral --sandbox --json-schema --tools --restricted --safe-mode --permission-prompts --no-session-persistence'; exit 0;; --output-schema) shift; schema=$1;; --output-last-message) shift; reply=$1;; --json-schema) shift; schema=$1;; esac shift done while IFS= read -r line; do :; done classification=0 case "$provider" in codex) while IFS= read -r line; do case "$line" in *'"activity"'*) classification=1;; esac; done < "$schema";; *) case "$schema" in *'"activity"'*) classification=1;; esac;; esac if [ "$classification" = 1 ]; then wire='{"schemaVersion":1,"activity":"summarize"}' else wire='{"schemaVersion":1,"summary":"Native subprocess fixture summary; source DSC-0001","topics":[],"surveys":[],"entries":[],"dispositions":[],"decision":null}' fi case "$provider" in codex) printf '%s\n' "$wire" > "$reply"; printf '{"type":"turn.completed"}\n';; *) printf '{"subtype":"success","is_error":false,"structured_output":%s}\n' "$wire";; esac AIE_PROVIDER cp providers/codex providers/claude chmod +x providers/codex providers/claude export AIE_CODEX_EXECUTABLE="$aie_fixture/providers/codex" export AIE_CLAUDE_EXECUTABLE="$aie_fixture/providers/claude" cd local-cli printf '1\ngeneral\ndefault\n5\n1\n3\nreviewer\ndefault\n5\n1\n' > setup.txt aie_without_git init . --name 'Native CLI fixture' --interactive --input-file setup.txt > setup.yaml aie_without_git agent doctor --format json > doctor.json grep -q '"compatible" : true' doctor.json aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Provider protocol' > work.yaml aie_without_git discussion add WRK-0001 --text 'Synthetic source for provider protocol tests' > source.md aie_without_git agent run WRK-0001 --task 'Summarize the synthetic note' --request-id classified --format json > codex.json grep -q '"classification" : {' codex.json aie_without_git agent run WRK-0001 --activity analyze --task 'Continue from persisted context' --request-id reviewed --format json > claude.json grep -q '"transport" : "claude-cli"' claude.json grep -q '"fixture" : false' claude.json cp .ai-engineering/works/WRK-0001-provider-protocol/work.md before-replay.md aie_without_git agent run WRK-0001 --activity analyze --task 'Continue from persisted context' --request-id reviewed > replay.md cmp before-replay.md .ai-engineering/works/WRK-0001-provider-protocol/work.md aie_without_git work context WRK-0001 --format json > before.json mkdir -p src/nested cd src/nested aie_without_git work context WRK-0001 --format json > ../../after.json cd ../.. cmp before.json after.json aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json cd "$aie_fixture" unset AIE_CODEX_EXECUTABLE AIE_CLAUDE_EXECUTABLE echo 'Native local-CLI transport smoke passed (controlled subprocess fixtures, guided setup, routing, provenance, replay and reload without JVM/models).' # EPIC state control is entirely deterministic and does not need configured agents. mkdir epic-coordination cd epic-coordination aie_without_git init --name 'EPIC coordination fixture' > init.yaml for aie_title in Parent Required Cancelled Optional; do aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" "$aie_title" --acceptance 'Reviewed fixture result' > "$aie_title.yaml" done aie_without_git epic configure WRK-0001 --mode results --by fixture-agent --reason 'Coordinate slices' > epic.md for aie_child in WRK-0002 WRK-0003 WRK-0004; do aie_without_git epic link WRK-0001 "$aie_child" --by fixture-agent --reason 'Decomposition' > link.md done aie_without_git epic importance WRK-0001 WRK-0004 --optional --by fixture-owner --reason 'Follow-up only' > optional.md aie_without_git epic authorize WRK-0001 --by fixture-owner --reason 'Explicit aggregate delegation' --human-approved > authorized.yaml printf 'Synthetic delivery evidence, not real product validation\n' > evidence.txt aie_without_git artifact add WRK-0002 --file evidence.txt --purpose 'Synthetic delivery' > artifact.yaml aie_without_git work complete WRK-0002 --by fixture-owner --summary 'Reviewed fixture' --human-approved \ --criterion 1=ART-0001 --no-integration-needed 'Disposable fixture' --requester fixture-agent --request-id child-delivery --format json > first-result.json grep -q WRK-0003 first-result.json aie_without_git work status WRK-0003 CANCELLED --by fixture-owner --reason 'Requires scope review' > cancelled.yaml if aie_without_git epic check WRK-0001 --format json > pending.json; then echo 'An important cancelled child unexpectedly satisfied the EPIC' >&2; exit 1 else test "$?" -eq 4 fi grep -q CANCELLED pending.json aie_without_git epic importance WRK-0001 WRK-0003 --optional --by fixture-owner --reason 'Explicitly reviewed exclusion' > reviewed-scope.md aie_without_git epic authorize WRK-0001 --by fixture-owner --reason 'Reduced aggregate scope approved' --human-approved > second-authority.yaml aie_without_git work context WRK-0001 --format json > before.json aie_without_git work context WRK-0001 --format markdown > before.md grep -q SYSTEM_EPIC before.json grep -q '"humanApproved" : false' before.json aie_without_git work show WRK-0004 --format json > optional.json grep -q '"status" : "OPEN"' optional.json mkdir -p src/nested cd src/nested aie_without_git work context WRK-0001 --format json > ../../after.json aie_without_git work context WRK-0001 --format markdown > ../../after.md cd ../.. cmp before.json after.json cmp before.md after.md aie_without_git work archive WRK-0001 --by fixture-owner --reason 'Retain receipt' > archived.yaml aie_without_git work reopen WRK-0002 --by fixture-owner --reason 'New observation' > reopened.yaml aie_without_git work show WRK-0001 --format json > parent-reopened.json grep -q '"status" : "ACTIVE"' parent-reopened.json grep -q '"archived" : false' parent-reopened.json aie_without_git work complete WRK-0002 --by fixture-owner --summary 'Reviewed new fixture' --human-approved \ --criterion 1=ART-0001 --no-integration-needed 'Disposable fixture' > new-completion.yaml cp .ai-engineering/works/WRK-0001-parent/work.md completed-before-reconcile.md aie_without_git epic reconcile WRK-0001 --requester another-agent --request-id replay > reconciled.yaml cmp completed-before-reconcile.md .ai-engineering/works/WRK-0001-parent/work.md aie_without_git epic history WRK-0001 --format json > policy-history.json grep -q 'Explicitly reviewed exclusion' policy-history.json aie_without_git work reopen WRK-0001 --by fixture-owner --reason 'Explicitly begin replanning' > manual-reopen.yaml aie_without_git epic reconcile WRK-0001 > held-open.yaml aie_without_git work show WRK-0001 --format json > replanning.json grep -q '"status" : "ACTIVE"' replanning.json aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Decomposition' --acceptance 'Recorded decomposition' > decomposition.yaml aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Future execution' --acceptance 'Future child result' > future.yaml aie_without_git epic configure WRK-0005 --mode decomposition --by fixture-agent --reason 'Deliver only decomposition' > decomposition-policy.md aie_without_git epic link WRK-0005 WRK-0006 --by fixture-agent --reason 'Future scope' > future-link.md aie_without_git artifact add WRK-0005 --file evidence.txt --purpose 'Synthetic decomposition evidence' > decomposition-evidence.yaml aie_without_git work complete WRK-0005 --by fixture-owner --summary 'Decomposition reviewed' --human-approved \ --criterion 1=ART-0001 --no-integration-needed 'Disposable fixture' > decomposition-complete.yaml aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json test ! -e .git cd "$aie_fixture" echo 'Native EPIC smoke passed (delegation, important/cancelled/optional children, system receipts, reopen, replay, decomposition and nested context).' # Git initialization is fixture setup, never an implicit CLI operation. git init -q runtime git init -q studio for aie_repo in runtime studio; do git -C "$aie_repo" -c user.name=Fixture -c user.email=fixture@example.invalid \ commit -q --allow-empty -m fixture done "$aie_binary" init --name 'Continuity Experiment' > init.yaml "$aie_binary" repo add runtime --path runtime --language rust > runtime.yaml "$aie_binary" repo add studio --path studio --language java > studio.yaml "$aie_binary" work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Improve scene editor' --repo runtime --repo studio \ --goal 'Continue across agents' --constraint 'No server' \ --acceptance 'Fresh process reconstructs state' > work.yaml "$aie_binary" discussion add WRK-0001 --kind QUESTION --author agent-a \ --text 'Evaluate Canvas rendering?' > discussion.yaml printf 'Observed fixture result: 60 fps\n' > result.txt "$aie_binary" artifact add WRK-0001 --file result.txt --purpose 'Rendering evidence' > artifact.yaml "$aie_binary" decision draft WRK-0001 --title 'Evaluate layered Canvas' \ --evidence ART-0001 > decision.yaml "$aie_binary" work context WRK-0001 --format json > before.json mkdir -p studio/src/editor cd studio/src/editor "$aie_binary" work context WRK-0001 --format json > "$aie_fixture/after.json" cd "$aie_fixture" cmp before.json after.json for aie_expected in runtime studio agent-a DRAFT sha256 'Continue across agents'; do grep -q "$aie_expected" after.json done "$aie_binary" work context WRK-0001 --format markdown > context.md "$aie_binary" project validate --format json > validation.json grep -q '"valid" : true' validation.json test ! -e .git echo 'Native multi-repository continuity smoke passed.' # Complete the same multi-repository Work; each command is a fresh native process. test -f .ai-engineering/README.md test -f .ai-engineering/protocol.json grep -q '.ai-engineering/README.md' AGENTS.md "$aie_binary" guide --format json > guide.json grep -q 'capabilities' guide.json cp AGENTS.md agents-before.md "$aie_binary" onboard > onboarding.yaml cmp agents-before.md AGENTS.md "$aie_binary" next-actions WRK-0001 --format json > actions.json grep -q 'RESPOND' actions.json "$aie_binary" discussion add WRK-0001 --kind CONCLUSION --responds-to DSC-0001 \ --text 'The disposable fixture supports the chosen approach.' > conclusion.md "$aie_binary" decision update WRK-0001 DEC-0001 --context 'Continuity fixture' \ --approach 'Persist a bounded result' --rationale 'Demonstrate fresh-process continuity' \ --by agent-a --reason 'Refine the proposal' > updated-decision.yaml "$aie_binary" decision accept WRK-0001 DEC-0001 --by fixture-owner --reason 'Reviewed fixture' \ --human-approved > accepted.yaml "$aie_binary" plan create WRK-0001 --title 'Validate continuity' --decision DEC-0001 > plan.yaml "$aie_binary" plan step add WRK-0001 PLN-0001 --title 'Check persisted result' > step.yaml "$aie_binary" plan step status WRK-0001 PLN-0001 TSK-0001 COMPLETED --by agent-b \ --reason 'Result payload checked in the fixture' --evidence ART-0001 > step-result.yaml "$aie_binary" plan status WRK-0001 PLN-0001 COMPLETED --by agent-b --reason 'Step result recorded' > finished-plan.yaml "$aie_binary" work check WRK-0001 > readiness.yaml "$aie_binary" work reconcile WRK-0001 --requester agent-b --request-id portable-completion > completion.yaml grep -q 'COMPLETED' completion.yaml grep -q 'SYSTEM_PLANS' step-result.yaml "$aie_binary" work archive WRK-0001 --by fixture-owner --reason 'Retain fixture evidence' > archive.yaml "$aie_binary" status --format json > status.json grep -q '"works" : \[ \]' status.json "$aie_binary" status --all --format json > all-status.json grep -q 'WRK-0001' all-status.json "$aie_binary" work context WRK-0001 --format json > closed-before.json cd studio/src/editor "$aie_binary" work context WRK-0001 --format json > "$aie_fixture/closed-after.json" cd "$aie_fixture" cmp closed-before.json closed-after.json for aie_expected in ACCEPTED PLN-0001 TSK-0001 scopeHash fixture-owner protocolGuide; do grep -q "$aie_expected" closed-after.json done "$aie_binary" decision history WRK-0001 DEC-0001 --format json > decision-history.json grep -q 'DRAFT' decision-history.json grep -q 'ACCEPTED' decision-history.json "$aie_binary" plan history WRK-0001 PLN-0001 --format json > plan-history.json grep -q 'All required steps completed' plan-history.json "$aie_binary" work reopen WRK-0001 --by fixture-owner --reason 'Continue with new observations' > reopened.yaml "$aie_binary" discussion add WRK-0001 --text 'A different agent can continue here.' --author agent-c > continuation.md "$aie_binary" decision revise WRK-0001 DEC-0001 --by agent-c --reason 'New observations justify reconsideration' > revised.yaml "$aie_binary" decision update WRK-0001 DEC-0002 --approach 'A revised bounded experiment' \ --by agent-c --reason 'Refined alternative' > refined.yaml "$aie_binary" decision accept WRK-0001 DEC-0002 --by fixture-owner --reason 'Reviewed revised scope' \ --human-approved > replacement.yaml "$aie_binary" decision list WRK-0001 --format json > decisions.json grep -q 'SUPERSEDED' decisions.json "$aie_binary" plan status WRK-0001 PLN-0001 ACTIVE --by agent-c --reason 'Reconsider the earlier plan' > reconsidered.yaml "$aie_binary" plan update WRK-0001 PLN-0001 --decision DEC-0002 --by agent-c --reason 'Align to the revised decision' > replanned.yaml "$aie_binary" plan step status WRK-0001 PLN-0001 TSK-0001 OPEN --by agent-c --reason 'Collect new evidence' > resumed-step.yaml "$aie_binary" work context WRK-0001 --format json > resumed.json grep -q 'SYSTEM_PLANS' resumed.json grep -q 'A different agent can continue here.' resumed.json "$aie_binary" project validate --format json > validation.json grep -q '"valid" : true' validation.json echo 'Native operational-cycle smoke passed (discovery, approval, plan, evidence, completion, archive and reopening).' # Automatic consolidation across independent native processes without Git/JVM/models. mkdir "$aie_fixture/plan-consolidation" cd "$aie_fixture/plan-consolidation" aie_without_git init --name 'Plan consolidation' > init.yaml aie_without_git work create --mode DIRECT --approval WAIVED --human-approved --choice-reason "Explicit synthetic fixture policy" 'Delivery' > work.yaml printf 'Synthetic executed result\n' > result.txt aie_without_git artifact add WRK-0001 --file result.txt --purpose 'Fixture execution' > evidence.yaml aie_without_git next-actions WRK-0001 --format json > empty-actions.json grep -q CREATE_PLAN empty-actions.json aie_without_git plan create WRK-0001 --title 'First' > plan1.yaml aie_without_git plan create WRK-0001 --title 'Second' > plan2.yaml aie_without_git plan step add WRK-0001 PLN-0001 --title 'First result' > step1.yaml aie_without_git plan step add WRK-0001 PLN-0002 --title 'Second result' > step2.yaml aie_without_git plan step add WRK-0001 PLN-0002 --title 'Withdrawn scope' > cancelled-step.yaml aie_without_git plan step status WRK-0001 PLN-0001 TSK-0001 COMPLETED --by fixture \ --reason 'Fixture result checked' --evidence ART-0001 --format json > first-result.json grep -q 'PLN-0002' first-result.json aie_without_git plan step status WRK-0001 PLN-0002 TSK-0002 CANCELLED --by fixture --reason 'Deferred' > cancelled.yaml aie_without_git plan step status WRK-0001 PLN-0002 TSK-0001 COMPLETED --by fixture \ --reason 'Fixture result checked' --evidence ART-0001 > second-result.yaml aie_without_git work show WRK-0001 --format json > pending.json grep -q '"status" : "OPEN"' pending.json aie_without_git plan exclude WRK-0001 PLN-0002 --step TSK-0002 --by fixture-human \ --reason 'Explicit scope reduction' --format json > reviewed.json grep -q SYSTEM_PLANS reviewed.json aie_without_git work check WRK-0001 > ready.yaml cp .ai-engineering/works/WRK-0001-delivery/work.md delivered-before.md aie_without_git work reconcile WRK-0001 --requester fresh-agent --request-id retry --format json > replay.json cmp delivered-before.md .ai-engineering/works/WRK-0001-delivery/work.md aie_without_git work context WRK-0001 --format json > before.json mkdir nested cd nested aie_without_git work context WRK-0001 --format json > ../after.json cd .. cmp before.json after.json aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json echo 'Native Plan consolidation smoke passed (multiple Plans, reviewed cancellation, system completion and fresh-process replay; no model/JVM).' # Human conduct and optional OODA across fresh native processes without Git/JVM/model. mkdir "$aie_fixture/work-guidance" cd "$aie_fixture/work-guidance" aie_without_git init --name 'Human conduct and experiments' > init.yaml aie_without_git work create 'Explicit human control' > unspecified.yaml aie_without_git next-actions WRK-0001 --format json > unspecified-actions.json grep -q ASK_DISCUSSION_MODE unspecified-actions.json if grep -q CREATE_PLAN unspecified-actions.json; then exit 1; fi if aie_without_git decision draft WRK-0001 --title 'Premature' > refused-draft.txt 2>&1; then exit 1; else test "$?" -eq 2; fi aie_without_git work guidance WRK-0001 --mode EXPLORATORY --by fixture-human \ --reason 'Explicit exploratory fixture choice' --human-approved > exploratory.yaml aie_without_git work guidance WRK-0001 --approval WAIVED --by fixture-human \ --reason 'Explicit Work-wide fixture waiver' --human-approved > waiver.yaml if aie_without_git decision draft WRK-0001 --title 'Still premature' > unrequested.txt 2>&1; then exit 1; else test "$?" -eq 2; fi aie_without_git work request-decision WRK-0001 --by fixture-human \ --reason 'Human concluded exploration and requested DEC' --human-approved > requested.yaml aie_without_git decision draft WRK-0001 --title 'Measured approach' --context 'Fixture latency' \ --approach 'Measure batching under the agreed limits' --rationale 'Evidence guides implementation' > draft.yaml aie_without_git plan create WRK-0001 --title 'Adaptive delivery' --decision DEC-0001 > plan.yaml aie_without_git plan step add WRK-0001 PLN-0001 --title 'Optimize' > optimize.yaml aie_without_git plan step add WRK-0001 PLN-0001 --title 'Independent documentation' > independent.yaml aie_without_git plan experiment start WRK-0001 PLN-0001 --step TSK-0001 \ --hypothesis 'Batching meets target' --criterion 'Latency below 10ms' \ --invocation 'Synthetic smoke measurement' --by fixture-agent --reason 'Record criteria first' > started.yaml printf 'Synthetic fixture observation: latency 17ms\n' > measurement.txt aie_without_git artifact add WRK-0001 --file measurement.txt --purpose 'Synthetic measured result' > evidence.yaml aie_without_git plan step status WRK-0001 PLN-0001 TSK-0002 COMPLETED --by fixture-agent \ --reason 'Independent fixture result' --evidence ART-0001 > independent-result.yaml if aie_without_git plan step status WRK-0001 PLN-0001 TSK-0001 COMPLETED --by fixture-agent \ --reason 'Premature completion' --evidence ART-0001 > pending-experiment.txt 2>&1; then exit 1; else test "$?" -eq 2; fi aie_without_git plan experiment finish WRK-0001 PLN-0001 EXP-0001 --outcome REFUTED \ --observation 'Latency measured 17ms' --interpretation 'Batching is insufficient' \ --next-action 'Investigate a revised approach' --evidence ART-0001 --questions-decision DEC-0001 \ --by fixture-agent --reason 'Evidence changes next action' > observed.yaml aie_without_git next-actions WRK-0001 --format json > concern-actions.json grep -q REVISIT_DECISION concern-actions.json if aie_without_git plan step status WRK-0001 PLN-0001 TSK-0001 COMPLETED --by fixture-agent \ --reason 'Contradict DEC' --evidence ART-0001 > questioned.txt 2>&1; then exit 1; else test "$?" -eq 2; fi aie_without_git work request-decision WRK-0001 --by fixture-human \ --reason 'Human requested revision after discussing the measurement' --human-approved > revision-request.yaml aie_without_git decision revise WRK-0001 DEC-0001 --by fixture-agent --reason 'Measurement requires revision' > revised.yaml aie_without_git decision update WRK-0001 DEC-0002 --approach 'Revised measured approach' \ --by fixture-agent --reason 'Recorded changed approach' > updated.yaml aie_without_git decision accept WRK-0001 DEC-0002 --by fixture-human \ --reason 'Human reviewed the revised DEC' --human-approved > approved.yaml aie_without_git plan update WRK-0001 PLN-0001 --decision DEC-0002 --by fixture-agent \ --reason 'Use approved DEC revision' > replanned.yaml aie_without_git plan step status WRK-0001 PLN-0001 TSK-0001 COMPLETED --by fixture-agent \ --reason 'Verified revised fixture result' --evidence ART-0001 > completed.yaml grep -q SYSTEM_PLANS completed.yaml aie_without_git plan experiment list WRK-0001 PLN-0001 --format json > experiment-history.json grep -q 'Investigate a revised approach' experiment-history.json aie_without_git work context WRK-0001 --format json > context.json grep -q 'EXPLORATORY' context.json grep -q 'guidanceInstructions' context.json aie_without_git work create 'Default review' > default-review.yaml aie_without_git work guidance WRK-0002 --mode DIRECT --by fixture-human \ --reason 'Explicit direct fixture choice' --human-approved > direct.yaml aie_without_git decision draft WRK-0002 --title 'Concrete DEC' --context 'Simple fixture' \ --approach 'Small change' --rationale 'Bounded' > required-draft.yaml if aie_without_git plan create WRK-0002 --title 'Bypass review' --decision DEC-0001 > required-review.txt 2>&1; then exit 1; else test "$?" -eq 2; fi aie_without_git decision accept WRK-0002 DEC-0001 --by fixture-human \ --reason 'Approve concrete DEC' --human-approved > required-approval.yaml aie_without_git plan create WRK-0002 --title 'Authorized' --decision DEC-0001 > authorized.yaml aie_without_git project validate --format json > validation.json grep -q '"valid" : true' validation.json echo 'Native Work guidance/OODA smoke passed (human mode/request/approval, explicit waiver, criteria, evidence, independent execution and approved DEC revision).' if [[ "${AIE_KEEP_FIXTURE:-0}" == 1 ]]; then echo "Fixture retained: $aie_fixture"; fi