chore(agents): upgrade Agent Foundry to 0593562 #79

Merged
claudiomaradonna merged 1 commit from chore/foundry-upgrade-0593562 into master 2026-11-16 10:25:32 +01:00
Collaborator

Why

This repository's agent policy, skills and subagent briefs come from Agent Foundry, and the foundry-upgrade skill brings newer source commits in. The source has two new commits since the last upgrade (017383c), both about fold-branch. Agents use that skill to fold fixups into a branch before every push, pull request and merge. When the branch has more than one commit, it reruns the every-commit checks on each commit through git rebase --exec.

Every change here happens in a linked worktree under .worktrees/<branch>. In a linked worktree, git rebase exports GIT_DIR to the --exec command. Any Git command a check starts in another repository, such as a tool's cache clone or a test fixture, then reads and writes the folded repository instead of its own.

What changed

Before, fold-branch step 2 ran --exec '<fast checks>'. Now it runs --exec 'unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR; <fast checks>', and a new sentence explains why. The checks start at the worktree's top level, so Git still finds the folded repository from there, while Git commands in other repositories act on their own. The variables that pass the sandbox's Git settings (GIT_CONFIG_COUNT, GIT_CONFIG_PARAMETERS) stay set.

The foundry-upgrade Record now names 0593562 as the adopted commit. The source's other change, a pin test in its own tests/, stays in the source, as its UPGRADING.md says. No upgrade migration applies.

How to verify

Base 0e802fe, branch aaf5ddb; Git 2.53.0. The trial below builds a throwaway repository with a linked worktree and folds a two-commit branch. Each --exec check writes a marker with git config in a second repository. It runs the check once in the base form and once in the branch form.

#!/usr/bin/env bash
set -euo pipefail

root=$1
rm -rf "$root"
mkdir -p "$root"
export GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1
export GIT_AUTHOR_NAME=Trial GIT_AUTHOR_EMAIL=trial@example.test
export GIT_COMMITTER_NAME=Trial GIT_COMMITTER_EMAIL=trial@example.test

git init -q -b main "$root/project"
git -C "$root/project" commit -q --allow-empty -m base
git -C "$root/project" worktree add -q -b topic "$root/project-wt" main
git -C "$root/project-wt" commit -q --allow-empty -m one
git -C "$root/project-wt" commit -q --allow-empty -m two

trial() {
  local label=$1 prefix=$2 other="$root/other-$1"
  git init -q "$other"
  (cd "$root/project-wt" &&
    git rebase -q --keep-base --force-rebase \
      --exec "${prefix}cd '$other' && git config trial.mark set-by-check" main)
  printf '%s: project trial.mark=%s, other trial.mark=%s\n' "$label" \
    "$(git -C "$root/project" config --get trial.mark || echo '-')" \
    "$(git -C "$other" config --get trial.mark || echo '-')"
  git -C "$root/project" config --unset-all trial.mark 2>/dev/null || true
}

trial base ''
trial branch 'unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR; '

Save it as fold-trial.sh and run bash fold-trial.sh /tmp/fold-trial. Expected and observed output:

base: project trial.mark=set-by-check, other trial.mark=-
branch: project trial.mark=-, other trial.mark=set-by-check

In the base form, the check's git config lands in the folded project. In the branch form, it lands in the repository the check meant.

Checks run on aaf5ddb:

  • The source's scripts/verify-agent-config.sh prints agent configuration statically valid: state=initialized.
  • make lint && .agents/hooks/shellcheck.sh repo && make test passes (shell check: 58 files clean). Run inside Claude Code's sandbox, integration/test_env_isolation.sh and integration/test_identity.sh fail only because the sandbox blocks the agent stub's Unix socket.
  • prettier --check passes on both changed files.

Considerations

Today the fix doesn't change this repository's own fold. Its every-commit checks, make lint && make test, start no Git command. It matters once a check or a tool it starts runs Git in a repository of its own.

The upgrade skipped step 5's Codex hook setup in the upgrade worktree, because this branch sees no Codex use and .codex/hooks.json is unchanged.

## Why This repository's agent policy, skills and subagent briefs come from [Agent Foundry](https://git.unitoo.it/claudiomaradonna/agent-foundry), and the `foundry-upgrade` skill brings newer source commits in. The source has two new commits since the last upgrade (017383c), both about `fold-branch`. Agents use that skill to fold fixups into a branch before every push, pull request and merge. When the branch has more than one commit, it reruns the every-commit checks on each commit through `git rebase --exec`. Every change here happens in a linked worktree under `.worktrees/<branch>`. In a linked worktree, `git rebase` exports `GIT_DIR` to the `--exec` command. Any Git command a check starts in another repository, such as a tool's cache clone or a test fixture, then reads and writes the folded repository instead of its own. ## What changed Before, `fold-branch` step 2 ran `--exec '<fast checks>'`. Now it runs `--exec 'unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR; <fast checks>'`, and a new sentence explains why. The checks start at the worktree's top level, so Git still finds the folded repository from there, while Git commands in other repositories act on their own. The variables that pass the sandbox's Git settings (`GIT_CONFIG_COUNT`, `GIT_CONFIG_PARAMETERS`) stay set. The `foundry-upgrade` Record now names `0593562` as the adopted commit. The source's other change, a pin test in its own `tests/`, stays in the source, as its `UPGRADING.md` says. No upgrade migration applies. ## How to verify Base `0e802fe`, branch `aaf5ddb`; Git 2.53.0. The trial below builds a throwaway repository with a linked worktree and folds a two-commit branch. Each `--exec` check writes a marker with `git config` in a second repository. It runs the check once in the base form and once in the branch form. ```bash #!/usr/bin/env bash set -euo pipefail root=$1 rm -rf "$root" mkdir -p "$root" export GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 export GIT_AUTHOR_NAME=Trial GIT_AUTHOR_EMAIL=trial@example.test export GIT_COMMITTER_NAME=Trial GIT_COMMITTER_EMAIL=trial@example.test git init -q -b main "$root/project" git -C "$root/project" commit -q --allow-empty -m base git -C "$root/project" worktree add -q -b topic "$root/project-wt" main git -C "$root/project-wt" commit -q --allow-empty -m one git -C "$root/project-wt" commit -q --allow-empty -m two trial() { local label=$1 prefix=$2 other="$root/other-$1" git init -q "$other" (cd "$root/project-wt" && git rebase -q --keep-base --force-rebase \ --exec "${prefix}cd '$other' && git config trial.mark set-by-check" main) printf '%s: project trial.mark=%s, other trial.mark=%s\n' "$label" \ "$(git -C "$root/project" config --get trial.mark || echo '-')" \ "$(git -C "$other" config --get trial.mark || echo '-')" git -C "$root/project" config --unset-all trial.mark 2>/dev/null || true } trial base '' trial branch 'unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR; ' ``` Save it as `fold-trial.sh` and run `bash fold-trial.sh /tmp/fold-trial`. Expected and observed output: ```text base: project trial.mark=set-by-check, other trial.mark=- branch: project trial.mark=-, other trial.mark=set-by-check ``` In the base form, the check's `git config` lands in the folded project. In the branch form, it lands in the repository the check meant. Checks run on `aaf5ddb`: - The source's `scripts/verify-agent-config.sh` prints `agent configuration statically valid: state=initialized`. - `make lint && .agents/hooks/shellcheck.sh repo && make test` passes (`shell check: 58 files clean`). Run inside Claude Code's sandbox, `integration/test_env_isolation.sh` and `integration/test_identity.sh` fail only because the sandbox blocks the agent stub's Unix socket. - `prettier --check` passes on both changed files. ## Considerations Today the fix doesn't change this repository's own fold. Its every-commit checks, `make lint && make test`, start no Git command. It matters once a check or a tool it starts runs Git in a repository of its own. The upgrade skipped step 5's Codex hook setup in the upgrade worktree, because this branch sees no Codex use and `.codex/hooks.json` is unchanged.
Takes the source's fold-branch fix: the fold's --exec checks now unset
the GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE, and GIT_COMMON_DIR that
git rebase exports in a linked worktree, so Git commands the checks
start act on their own repository rather than this one.
claudiomaradonna deleted branch chore/foundry-upgrade-0593562 2026-11-16 10:25:37 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
claudiomaradonna/azkaban!79
No description provided.