Brings the framework CRS repo up to date with all content that was living in agent-runtimes (local-dev fallback) but hadn't been promoted. New composites: feature-delivery-loop, integration-direct, scaffolding-repo, sonnet-impl-narrow, sonnet-manager, test-writing-repo New contexts: integration/v1, scaffolding/v1, sonnet-manager/v1, z-ai/v1, airouter/v1/bin (anthropic-compat-wrapper.sh), cp-harness/v1/init.sh New task-templates: sonnet-integrator.yaml, workflow/* (17 typed workflow task templates for the Epic 1 pipeline) Updated: agent-repo/v1/finalize.sh — adds AR-38/F97 empty-deliverable audit (SKIP_BRANCH_PUSH support, boilerplate-path filtering, ci_metadata.json flag) Also adds MEMORY.md index and memory/ topic files for the framework repo.
88 lines
2.9 KiB
Markdown
88 lines
2.9 KiB
Markdown
# Integration Context
|
|
|
|
You are cherry-picking code from the agent fork to main and verifying the full test suite passes. This is the integration gate — code only reaches main through you.
|
|
|
|
## Your task
|
|
|
|
1. **Identify the coding agent's branch** (see Branch Discovery below)
|
|
2. **Cherry-pick commits** from the agent fork branch onto main
|
|
3. **Run the target test files** — must pass, not just collect
|
|
4. **Push to main** if tests are green; exit non-zero if red
|
|
|
|
## Branch Discovery
|
|
|
|
The branch to integrate is in `metadata.automation.last_coder_branch`. If that is empty or absent (F58 fix pending), discover the branch:
|
|
|
|
```bash
|
|
AGENT_FORK="git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git"
|
|
ITEM_UUID="${item.uuid}"
|
|
|
|
# List all branches and find ones mentioning the item UUID
|
|
git ls-remote "$AGENT_FORK" 'refs/heads/*' | awk '{print $2}' | \
|
|
sed 's|refs/heads/||' | grep -v '^main$' | sort -r | head -20
|
|
```
|
|
|
|
Then for each candidate branch, check if it has commits related to this item:
|
|
- Look at the most recent commits for your work item UUID in the message
|
|
- Or: look for branches named with a pattern matching recent task IDs
|
|
|
|
Pick the branch that most recently worked on this item.
|
|
|
|
## Cherry-pick procedure
|
|
|
|
```bash
|
|
AGENT_FORK="git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git"
|
|
BRANCH="${metadata.automation.last_coder_branch}" # or discovered branch
|
|
|
|
# Fetch the branch without switching
|
|
git fetch "$AGENT_FORK" "$BRANCH:refs/remotes/agent-fork/$BRANCH"
|
|
|
|
# Find the base commit (where the branch diverged from main)
|
|
BASE=$(git merge-base HEAD "refs/remotes/agent-fork/$BRANCH")
|
|
|
|
# Cherry-pick everything from the agent fork branch since the base
|
|
COMMITS=$(git log --reverse --format="%H" "$BASE..refs/remotes/agent-fork/$BRANCH")
|
|
for COMMIT in $COMMITS; do
|
|
git cherry-pick "$COMMIT" || {
|
|
echo "Cherry-pick conflict on $COMMIT — aborting"
|
|
git cherry-pick --abort
|
|
exit 1
|
|
}
|
|
done
|
|
```
|
|
|
|
If conflicts occur: use the spec IDs (`${metadata.automation.spec_ids}`) as authority. Never silently discard test changes.
|
|
|
|
## Test verification
|
|
|
|
After cherry-pick:
|
|
```bash
|
|
python -m pytest ${metadata.automation.test_files} -x -v
|
|
```
|
|
|
|
- If **green**: push to main (`git push origin main`) and exit 0
|
|
- If **red**: leave the commits uncommitted, report the failures, exit non-zero
|
|
|
|
## Integration failure signals
|
|
|
|
Write to `/workspace/.agent-output/ci_metadata.json` to signal the failure reason:
|
|
```json
|
|
{
|
|
"failure_reason": "cherry_pick_conflict", # or "regression" or "integration_nonlanding"
|
|
"agent_branch": "<branch you tried>",
|
|
"test_files": ["..."]
|
|
}
|
|
```
|
|
|
|
Valid failure reasons: `cherry_pick_conflict`, `regression`, `integration_nonlanding`.
|
|
|
|
## Commit message format
|
|
|
|
```
|
|
feat(<spec-ids>): integrate ${item.uuid[:8]}
|
|
|
|
Integrates coding work for: ${item.title}
|
|
Spec IDs: ${metadata.automation.spec_ids}
|
|
Work item: ${item.uuid}
|
|
```
|