Skip to content

Use a host-assigned checkout as the task worktree; unpin the validator; tag releases - #6

Merged
AnkitTheCoder merged 6 commits into
mainfrom
claude/cloud-environment-setup-bec7jo
Nov 17, 2026
Merged

AnkitTheCoder merged 6 commits into
mainfrom
claude/cloud-environment-setup-bec7jo

Conversation

@AnkitTheCoder

@AnkitTheCoder AnkitTheCoder commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

Factory skill (0.9.0 → 0.10.0)

  • When the host or consumer policy gives a task a dedicated checkout and an assigned task branch, Factory uses them as the task worktree and branch, but only when the checkout is clean and its HEAD is the fetched target.
  • A clean checkout that is only behind the target gets a fast-forward-only update and a recheck. If that update fails or is not allowed, Factory preserves the checkout and stops for a decision. It does not reset, rebase or start from the older revision.
  • A dirty checkout, or one with commits the target lacks, gets the separate worktree only where the host can publish a factory/<id> branch. Otherwise Factory preserves the checkout and stops with the decision needed.
  • In every other case, Factory creates the separate factory/<id> worktree as before.
  • Reason: a hosted agent session accepts pushes only to its assigned branch, so a fixed factory/<id> branch cannot be published there, and a sibling worktree is outside the folder the session exposes.
  • New eval case 08-assigned-checkout has five variants: clean assigned checkout, ahead and dirty on a restricted host, behind the target, refused fast-forward, and a workstation checkout.

CI

  • PR quality installs the current Claude Code release for claude plugin validate ., not version 2.1.220. The job still prints the validator version.
  • New Release tag workflow: on each push to main, it creates v<version> from plugin.json when that tag does not exist.

Docs

  • REVIEW.md and docs/self-hosting.md describe the unpinned validator and the release tag as the rollback point.

Verification

Check Result Where
PR quality / Validate plugin repository on f9f8df6 Passed GitHub Actions
python3 -m unittest discover -s tests Passed, 7 tests Claude Code cloud session
python3 scripts/validate_repository.py --base-ref origin/main Passed Claude Code cloud session
git diff --check Passed Claude Code cloud session
claude plugin validate . (Claude Code 2.1.323) Passed, with directory notices for a missing license and icon Claude Code cloud session
Release tag workflow Not run; it first runs after merge —
Behavioral eval (case 08, baseline and candidate) Not run Needs a trusted machine

Limits

  • The skill change has no behavioral evidence yet. All variants of case 08 were written before any run.
  • Review so far is a read-through recorded in the comments; its three findings are addressed in 302b257 and f9f8df6.
  • After merge, the workflow creates v0.10.0. The tag v0.9.0 for the earlier release must be created by hand on commit 2c561ba.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GmnQVszt5GLFBUCSZMR6kv

Install the latest Claude Code release in the PR quality job instead of
version 2.1.220. The pin was three months old when it was added and had
no update routine, so CI validated against rules older than the hosts
that install the plugin. The job keeps printing the validator version.

Verification: 7 validator tests passed; repository validation passed
against origin/main; git diff --check passed; claude plugin validate
passed with Claude Code 2.1.323 (the current release) in a Claude Code
cloud session, with directory notices for a missing license and icon.
The GitHub workflow has not run on this revision. No shipped skill
behavior changes, so no behavioral eval and no version bump.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmnQVszt5GLFBUCSZMR6kv
The self-hosting guide tells a task to fall back to the last known-good
release, but the repository had no tags and the marketplace catalog
follows the default branch, so no earlier release could be named or
installed. Record that a person tags each version-changing merge and
that the tag is the way back.

Verification: repository validation passed against origin/main; git
diff --check passed. Documentation only: no shipped skill behavior
changes, so no behavioral eval and no version bump.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmnQVszt5GLFBUCSZMR6kv
Add a Release tag workflow that runs on pushes to main and creates
v<version> from plugin.json when that tag does not exist. The
self-hosting guide now names the workflow as the owner of the tag.

Verification: workflow YAML parsed; repository validation passed
against origin/main. The workflow itself has not run; it first runs
after merge.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmnQVszt5GLFBUCSZMR6kv
When the host or consumer policy gives a task a dedicated checkout and
an assigned task branch, Factory now uses them as the task worktree and
branch after confirming the checkout is clean and holds no commits
beyond the fetched target. In every other case it creates the separate
factory/<id> worktree as before. A hosted agent session accepts pushes
only to its assigned branch, so the fixed branch name could not be
published there.

Add eval case 08 for the assigned-checkout route and bump the plugin
to 0.10.0.

Verification: 7 validator tests passed; repository validation passed
against origin/main; git diff --check passed; claude plugin validate
passed with Claude Code 2.1.323. Limits: no behavioral eval was run.
Case 08 was written before any run and has no baseline or candidate
result yet; qualification on a trusted machine is still open.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmnQVszt5GLFBUCSZMR6kv
The guard for a host-assigned checkout accepted any clean checkout with
no commits beyond the fetched target, so a checkout behind the target
also passed. Require HEAD to be the fetched SHA, fast-forward a clean
checkout that is only behind, and keep the separate worktree for a
dirty checkout or one with commits the target lacks. Case 08 gains a
behind-target variant.

Verification: 7 validator tests passed; repository validation passed
against origin/main; git diff --check passed. Limits: no behavioral
eval was run; the new variant was written before any run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmnQVszt5GLFBUCSZMR6kv
@AnkitTheCoder

Copy link
Copy Markdown
Collaborator Author

Reviewed current head 302b257.

The earlier behind-target concern is addressed: start step 4 now requires HEAD to equal the fetched SHA, and case 08 includes the behind-target variant. The existing stale-ref prohibition already mitigated the old wording; the explicit equality check removes the ambiguity.

Two remaining suggestions:

  1. Make the separate-worktree fallback conditional on host support. Step 4 and the task-folder contract still require that fallback for dirty or ahead checkouts. The PR's motivating host permits only the assigned branch and exposed checkout, so this can recreate the original publication/access blocker. If the fallback is unsupported, preserve the checkout and stop with the specific decision needed rather than starting work on an unusable branch.

  2. Specify the fast-forward failure path and qualify it. Use a fast-forward-only update, then recheck cleanliness and exact HEAD before task work. If the update fails or is disallowed, preserve the checkout and stop rather than resetting, rebasing or proceeding from the older revision. Extend case 08 with a failed fast-forward and a restricted-host dirty/ahead checkout, then run baseline/candidate qualification. The latest commit still records behavioral evals as unrun.

These are contract/recovery recommendations from a read-through, not a claim of a reproduced execution failure.

Two recovery paths for a host-assigned checkout were incomplete. The
separate-worktree fallback for a dirty or ahead checkout could start
work on a branch the host cannot publish; it now applies only where the
host can publish a factory/<id> branch, and otherwise Factory preserves
the checkout and stops for a decision. The behind-target update is now
fast-forward-only with a recheck, and a failed or disallowed update
stops without a reset or rebase. Case 08 covers both.

Verification: 7 validator tests passed; repository validation passed
against origin/main; git diff --check passed. Limits: no behavioral
eval was run; the new variants were written before any run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmnQVszt5GLFBUCSZMR6kv

Copy link
Copy Markdown
Collaborator Author

Both suggestions are correct. They are addressed in f9f8df6.

1. Separate-worktree fallback depends on host support

  • Step 4 in skills/factory/SKILL.md and the task-folder contract now use the separate worktree for a dirty or ahead checkout only where the host can publish a factory/<id> branch.
  • Where the host cannot, Factory preserves the checkout and stops with the specific decision needed. It does not start work on a branch that cannot be published.

2. Fast-forward failure path

  • The behind-target update is now fast-forward-only, followed by a recheck that the checkout is clean and exactly at the fetched SHA before any task work.
  • If the update fails or is not allowed, Factory preserves the checkout and stops for a decision. It does not reset, rebase or proceed from the older revision.

Case 08

  • Variant 2 is now a restricted-host checkout that is both ahead and dirty; the expected result is a stop, with no factory/<id> worktree.
  • New Variant 4 is a refused fast-forward; a reset or rebase is a failure signal.
  • The workstation checkout is now Variant 5.

Still open

  • Baseline and candidate qualification has not been run. It needs a trusted machine with configured coding agents, so it cannot run from this session. All variants of case 08 were written before any run.
  • Local checks on f9f8df6: 7 validator tests, repository validation against origin/main and git diff --check passed. PR quality runs on the push.

Generated by Claude Code

@AnkitTheCoder
AnkitTheCoder marked this pull request as ready for review November 17, 2026 20:53
@AnkitTheCoder
AnkitTheCoder merged commit 514f93f into main Nov 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants