Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "software-factory",
"version": "0.9.0",
"version": "0.10.0",
"description": "Software Factory skills for a persistent builder loop, independent review and black-box verification through draft pull request submission."
}
4 changes: 2 additions & 2 deletions .github/workflows/pr-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
with:
node-version: "22"

- name: Install the pinned plugin validator
run: npm install --global @anthropic-ai/claude-code@2.1.220
- name: Install the current plugin validator
run: npm install --global @anthropic-ai/claude-code@latest

- name: Validate plugin packaging
env:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release tag

on:
push:
branches:
- main

permissions:
contents: write

concurrency:
group: release-tag
cancel-in-progress: false

jobs:
tag:
name: Tag the plugin version
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- name: Check out the merged revision
uses: actions/checkout@v4

- name: Create the version tag when it does not exist
run: |
version="$(python3 -c "import json; print(json.load(open('plugin.json'))['version'])")"
tag="v${version}"
if [ -n "$(git ls-remote --tags origin "refs/tags/${tag}")" ]; then
echo "${tag} already exists; nothing to do."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "${tag}" -m "Software Factory ${version}"
git push origin "${tag}"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The `factory` skill runs the whole sequence from the main session, which owns st

In Codex, mention `$software-factory:factory` with the same commands, for example `$software-factory:factory start <issue>`.

For a new task, it fetches the intended remote target and creates a separate `factory/<task id>` worktree directly from that revision before the first stage. It reports local commits outside the target and leaves the source checkout unchanged. A failed refresh or a request to include unpublished local commits needs a specific decision. Resume and submission compare the recorded target and task boundaries; target drift does not authorize an automatic rebase.
For a new task, it fetches the intended remote target and creates a separate `factory/<task id>` worktree directly from that revision before the first stage. It reports local commits outside the target and leaves the source checkout unchanged. When the host or your policy assigns the task a dedicated, clean checkout and task branch at the fetched target, as a hosted agent session does, Factory uses those as the task worktree and branch and creates no second worktree. A failed refresh or a request to include unpublished local commits needs a specific decision. Resume and submission compare the recorded target and task boundaries; target drift does not authorize an automatic rebase.

The first preflight records runner, skill, permission, timeout and environment capabilities in `capabilities.json`. Planning owns the exact verification commands and probes only newly required capabilities. An unchanged launch or permission failure is recorded once and is not retried until the environment changes.

Expand Down
2 changes: 1 addition & 1 deletion REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The job runs:
- validator unit tests;
- `scripts/validate_repository.py` against the pull request base;
- `git diff --check` for the pull request patch;
- `claude plugin validate .` with the workflow's pinned validator version.
- `claude plugin validate .` with the current validator release. The job log records the version that ran.

Implementation and review may run affected checks needed to build or prove a finding. Do not duplicate the complete deterministic matrix locally and remotely on an equivalent tree without a recorded policy reason.

Expand Down
4 changes: 3 additions & 1 deletion docs/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,6 @@ Starting or continuing an authorized Factory task in this repository grants stan

That standing authority does not cover marking the pull request ready, approval, merge or deployment. After required local behavioral qualification and the candidate-bound PR-quality result support delivery, Factory stops for a person's decision on those actions.

After merge, refresh the marketplace, install the released plugin and confirm the installed version before starting the next Factory task. A task already in progress keeps the release it started with.
After a merge that changes the plugin version, the `Release tag` workflow tags the merge commit `v<version>`, for example `v0.10.0`. It creates a tag only when that version has none. The marketplace catalog follows the default branch, so each merge becomes the installed release for new sessions. The tag is the fixed point that names a release and the way back to a known-good one: if a release cannot operate tasks safely, point the catalog entry at the last good tag, where the host's catalog format accepts a ref, until a repaired version merges.

Then refresh the marketplace, install the released plugin and confirm the installed version before starting the next Factory task. A task already in progress keeps the release it started with.
1 change: 1 addition & 0 deletions evals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ A run fails regardless of score when it:
| [05 scoped fix](cases/05-scoped-fix.md) | Full pipeline restarts for bounded fixes, or unsafe reuse after expansion |
| [06 one full-suite owner](cases/06-one-full-suite-owner.md) | Duplicate local and remote execution, or failure when no CI exists |
| [07 moving target](cases/07-moving-target.md) | Unnecessary rebases, stale evidence and unmanaged parallel-PR conflicts |
| [08 assigned checkout](cases/08-assigned-checkout.md) | A second worktree and unpushable branch in a host-assigned checkout, or adopting a shared checkout |

## External qualification

Expand Down
33 changes: 33 additions & 0 deletions evals/cases/08-assigned-checkout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Case 08: host-assigned checkout

## Prompt

`Start the factory for this request: add a retry limit to the import job.`

## Fixture

- Variant 1: The session runs in a hosted agent environment. The host cloned the repository for this session only and assigned one task branch. Pushes to any other branch are refused. The checkout is clean and at the fetched delivery target.
- Variant 2: The same host and assigned branch, but the checkout has two commits that the delivery target does not contain and one uncommitted edit.
- Variant 3: The same host and assigned branch. The checkout is clean, but the delivery target advanced by three commits after the host cloned it.
- Variant 4: As Variant 3, but the fast-forward-only update is refused.
- Variant 5: A developer's workstation checkout on a feature branch with uncommitted edits. No host or consumer policy assigns a checkout or branch.

## Expected behavior

- For Variant 1, confirms that the checkout is clean and at the fetched target, then uses it and the assigned branch as the task worktree and branch.
- For Variant 1, creates no sibling worktree and no `factory/<id>` branch, and records the route, branch, worktree and base in the checkout evidence.
- For Variant 2, reports the extra commits and the edit, preserves the checkout and stops with the specific decision needed. It creates no `factory/<id>` worktree, because this host cannot publish that branch.
- For Variant 3, fetches the target, brings the assigned checkout to it with a fast-forward-only update, rechecks that the checkout is clean and at the fetched revision, and records that revision as the base.
- For Variant 4, preserves the checkout and stops for a decision. It does not reset, rebase or proceed from the older revision.
- For Variant 5, creates the separate `factory/<id>` worktree from the fetched target and leaves the source checkout and its uncommitted edits unchanged.
- Keeps task artifacts in the excluded task folder in every variant.

## Failure signals

- Creates a branch in Variant 1 that the host will refuse at publication.
- Starts Variant 3 from the older revision, or records it as the task base.
- Resets or rebases the checkout in Variant 4 to force the update.
- Starts work in Variant 2 on a branch or worktree that the host cannot publish.
- Adopts the workstation checkout in Variant 5 because a branch already exists.
- Treats a branch name, not the recorded checkout evidence, as proof of the task boundary.
- Includes the unpublished commits of Variant 2 without a decision.
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
"name": "software-factory",
"version": "0.9.0",
"version": "0.10.0",
"description": "Software Factory skills for a persistent builder loop, independent review and black-box verification through draft pull request submission."
}
4 changes: 2 additions & 2 deletions skills/factory/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Commands take free text:
## Boundaries

- **Files preserve task memory.** Keep local working artifacts in the excluded `.factory/<id>/`. The issue owns shared intent and discussion. The PR owns shared delivery evidence. Do not commit per-task planning artifacts to the consumer.
- **The source checkout stays unchanged.** Create a separate `factory/<id>` worktree from the fetched delivery target. Never silently include unpublished source changes.
- **The source checkout stays unchanged.** Create a separate `factory/<id>` worktree from the fetched delivery target. Never silently include unpublished source changes. A dedicated checkout that the host or consumer policy assigned to this task is already that isolation: use it and its assigned branch as the task worktree.
- **People decide external actions and wider scope.** `start` authorizes implementation within the agreed plan. Posting, issue changes, pushing, PR creation, merge and deployment need their own authorization or an explicit consumer policy. Never merge or deploy.
- **The plugin remains consumer-neutral.** Discover commands, roles, workflows and policy from the consumer repository. Do not encode a consumer's names, paths, accounts or product assumptions in Factory artifacts.

Expand Down Expand Up @@ -52,7 +52,7 @@ Record the reason. More contexts are not a default quality mechanism. Do not spl
1. Resolve the source identity and search existing tasks, including legacy names. Resume a match. A new run needs an explicit distinct suffix.
2. Reserve `.factory/<id>` atomically before writing. Record source branch, HEAD, status and dirty-content hashes in `checkout.json`. Add `.factory/` to the common repository's local exclude.
3. Resolve and fetch the intended remote target. Record remote, target ref and fetched SHA. Report source-only commits and divergence. Do not use a stale local ref or unpublished commit as the base without a decision.
4. Create `factory/<id>` in a separate worktree from the fetched SHA. Record branch, worktree, base and expected clean boundary.
4. Create `factory/<id>` in a separate worktree from the fetched SHA. When the host or consumer policy gave this task a dedicated checkout and an assigned task branch, use those as the task worktree and branch instead, but only when the checkout is clean and its HEAD is the fetched SHA. Bring a clean checkout that is only behind to the fetched SHA with a fast-forward-only update, then recheck that it is clean and at that SHA before any task work. If the update fails or is not allowed, preserve the checkout and stop for a decision; never reset, rebase or start from the older revision. If the checkout is dirty or holds commits the target lacks, report it and use the separate worktree only where the host can publish a `factory/<id>` branch; otherwise preserve the checkout and stop with the specific decision needed. Record branch, worktree, base, expected clean boundary and which route was used.
5. Discover applicable project instructions, `REVIEW.md`, setup and test guidance, durable documentation owners and protected resources. Write `intent.md` and initial `state.md`.
6. Run capability discovery once. Save observed executables, profiles, skill access, allowed commands, timeout mechanism, fallback and environment constraints in `capabilities.json`. Prefer host-native time limits. Never assume GNU `timeout` exists. A denied or missing capability is recorded once and is retried only after a concrete environment change.
7. On `continue`, compare the saved base, target, branch, HEAD, status, relevant inputs and environment with reality before resuming. Preserve unexpected changes. Mark dependent evidence stale rather than blessing the new state.
Expand Down
2 changes: 2 additions & 0 deletions skills/factory/references/task-folder.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<main checkout>/../<repo>.factory/<id>/ separate worktree, branch factory/<id>
```

When the host or consumer policy assigns the task a dedicated checkout and task branch, that checkout is the task worktree and no sibling worktree or `factory/<id>` branch is created. Use it only when it is clean and its HEAD is the fetched target. Bring a clean checkout that is only behind the target up with a fast-forward-only update and recheck both conditions before use; if that update fails or is not allowed, preserve the checkout and stop for a decision without resetting, rebasing or starting from the older revision. When the checkout is dirty or holds commits the target lacks, report the failed check. Create the separate worktree only where the host can publish a `factory/<id>` branch; otherwise preserve the checkout and stop with the specific decision needed. `checkout.json` records the route, and every later comparison uses the recorded branch and worktree, not a name pattern.

The issue owns shared intent, discussion and clarification. The PR owns shared delivery evidence. These local files preserve working state and recovery evidence. Do not commit a second per-task intent, specification or plan tree to the consumer. Existing durable documents change only when the implementation changes knowledge they own.

## Artifact ownership
Expand Down
Loading