Skip to content

Custom processes: compose Steps from a catalogue in a file - #1402

Merged
JacobStephens2 merged 48 commits into
mainfrom
issue-877
Oct 27, 2026
Merged

JacobStephens2 merged 48 commits into
mainfrom
issue-877

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #877

Adds experimental Custom processes in ~/.thirdshift/processes/<name>.toml, so users can compose work without changing thirdshift's Rust.

thirdshift process                         list definitions
thirdshift process check <name> [issue N]  validate and resolve the plan
thirdshift process <name> [issue N]        run its Steps
  skill sessions / commands / catalogue Steps
  sequential or parallel, in declared worktrees
  retained results → later Steps → final stdout
  Delivery / optional Self-merge / published-issue dispatch
  • Strict versioned validation rejects unknown keys, unsafe worktree sharing, invalid catalogue ordering and loosening limits. check shows each Step's skill location, effective Harness/Model/Effort, provenance and startup status.
  • Steps use repository, home or Factory skills and inherit omitted Command choices. Optional failures retain diagnostics; required failures stop execution and account for skipped Steps. Sessions retain traces and Model evidence, with trust/resource checks and Resume behavior.
  • Throwaway worktrees start detached at the Base branch. An Issue-branch Process holds a Claim, preserves failed work and uses existing Delivery/Repair behavior. Self-merge requires the Command or User config; file restrictions only tighten it. Published-issue dispatch preserves these choices, including limits on a Spec's child Tickets.
  • Processes join Pass locking, Stop/Ctrl-C, status, Console, Activity log and Run notifications. The manual, hand-written site pages and generated prompts document the experimental command.

Evidence

Seams under test: the thirdshift binary through the existing Scenario, real Git, fake GitHub and fake Harnesses; assertions cover CLI output, retained records/traces/results, worktrees and pull request state. Existing site browser checks cover the published documentation.

  • Before: focused regressions reproduced protected-rename Self-merge bypasses, ignored no-merge/file restrictions, missing traces and failed-command output, incomplete Step records, notification suppression and Resume errors. Both parallel home-skill probes reproduced missing files/publication errors.
    After: retained regressions pass; the home-skill stress probe passes all eight attempts. Added coverage checks Delivery restrictions on dispatched Tickets and Spec child Tickets, and a zero Repair cap.
  • Prompt regeneration and verification: 12 tests pass. Site browser checks: 50 pass.
  • scripts/affected-tests main: passed; 3225 Rust tests passed, 74 ignored across 77 targets (cargo test fallback). Selector wall time: 32m36s, including compilation, site checks and waiting for concurrent lint.
  • cargo fmt --all -- --check and cargo clippy --all-targets -- -D warnings: passed.

Unaddressed findings

Standards

None. All 5 findings addressed, including shared home-skill publication, recorded Sessions, Step identity decoding and duplicated test fixtures.

Spec

None. All 13 findings addressed. No findings were deferred to the Spec or Day shift.

Security

None.

Security review outcome

No unaddressed introduced findings.

Review coverage

Both independent axes covered all 55 changed files across the initial and follow-up reviews. Generated outputs were inspected directly; no generated-output exclusions. Unread changed files: none. Final bounded follow-up corrections were validated with the retained binary regressions.

Merge Danger

Door: two-way

No migration of existing run types into Process files. The new TOML format remains experimental.

Blast Radius: factory

Shared Session, skill publication, Harness and Delivery behavior also serves existing Commands. Child-run serialization now carries tightening Delivery limits; the full affected suite covers those existing flows.

Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh

Tickets

A ~/.thirdshift/processes file lists sequential skill Steps. thirdshift process lists them, check prints the plan, and running them shares one throwaway worktree and records the Command as Process.
The worktree follows the checked-out branch on origin. A missing file and invalid TOML name those rules, and the skill preamble and failure outcome are shared.
Add experimental Custom processes that run skill Steps in order
A Step that names nothing uses the Command's choice, including --harness. A Harness that can't start fails the Command before any session, with no fallback. process check prints each Step's choice, where it came from, and whether the Harness starts.
A command Step runs in its worktree and passes stdout followed by stderr
to later Steps. A non-zero exit fails the Process unless the Step is
optional. Stop interrupts a running command the way it interrupts a session.
A Step on another Harness takes the command's model and effort when it names none. Catalog preflight still refuses a model that Harness cannot run, before any session.
Add command Steps and optional Steps to Custom processes
A process can declare throwaway worktrees and group consecutive Steps that share a parallel name. A group runs together, each Step in its own worktree, and a failure waits for the other members before the process stops unless that Step is optional.
…hand

A Custom process skill is resolved in the repository first, then
~/.thirdshift/skills/<name>/SKILL.md, then the thirdshift-<name> Factory
skill. Home skills are linked into the worktree like the Factory skills,
and a repository skill of the same name wins.
Bring command Steps and optional Steps from #1382 onto named throwaway worktrees and parallel groups. A command Step counts as editing its worktree, so a parallel group still cannot share one.
A Trial binds that folder and not ~/.thirdshift/skills, so a link at the
home directory was unreadable. The worktree link now points at the copy.
check and the session prompt still name the home file.
Custom process: named throwaway worktrees and parallel groups
# Conflicts:
#	docs/guide.md
#	site/docs/index.html
#	tests/process.rs
`thirdshift process <name> issue <issue>` resolves a number or an Issue URL the way `thirdshift skill` does. Each session Step gets `.thirdshift-issue.md` and names the issue. An untrusted edit since the Process started fails the next session, a Resume included, before it starts. A command Step receives THIRDSHIFT_ISSUE_URL.
The Trial sandbox binds the Factory skills folder, not
~/.thirdshift/skills. The readability test invoked bwrap to prove the
copy was visible under those binds. CI does not install bwrap, so the
session exited 127. The published tree is plain files in that folder.
Give a Custom process an issue for its session Steps
Look up a Step skill in ~/.thirdshift/skills
status, show, the Console and the Activity log name a Custom process as Process <name>. A succeeded, failed or interrupted Process sends a Run notification under the same email rules as a Ticket run. A skipped one sends none. The stored kind stays Process.
)

A Custom process started with no issue takes the repository's Pass lock and is skipped, exiting 0 with no Run notification, while another Pass is still running. Its Command record ends skipped. A process started with an issue does not take the lock and is not skipped by it.
Pickup, Architect and Security runs take the same lock a Custom process with no issue holds, after their own preflight.
Skip a Custom process with no issue while another Pass is running (#1386)
Lanes, Stages and spans say Process <name>. show and the Console details print a Step result when the name has a space or a colon. A failure after the email check and before any Step still sends the Run notification.
# Conflicts:
#	README.md
#	docs/guide.md
#	site/docs/index.html
#	site/how-it-works/index.html
#	site/index.html
#	src/processes.rs
#	tests/process.rs
Show a Process by name and send its Run notification
…#1388)

A Process can name one issue-branch worktree and a delivery Step. The run
creates the Issue branch, holds the Claim, and leaves a ready-for-review
pull request. A missing issue or a missing delivery is refused before any
session.
catalogue = "run-published-issue" starts a Ticket run, or a Spec run up to spec.parallel, on the issue that session's final message names. The child run is recorded under the Process, and a failed check starts none.
Command, Command log, Activity log and Run notification now include the Process a Command keeps. The README names the catalogue Step, and the process tests pass the publish script directly.
The test job rejected needless borrows, a redundant closure, and
functions past clippy's argument limit. Delivery's envelope and publish
steps, a Process's worktree source, and a Step prompt now carry those
arguments in the types that already name them.
Run the issue a session Step published
# Conflicts:
#	README.md
#	docs/guide.md
#	site/docs/index.html
#	site/how-it-works/index.html
#	site/index.html
#	src/processes.rs
Publish an Issue-branch Process through Delivery and remove the Claim
)

A self-merge Step directly after delivery is the existing Self-merge. It
merges when the merge flag or merge_always asks, and otherwise leaves the
pull request ready for review. A file may only tighten the Repair cap,
forbid the merge, or name protected paths that hold it.
`**` resumed at every byte, so `**/key.txt` matched `mykey.txt`. It now
resumes at the next path segment, and `?` is one character. A Ticket run
and a Process share the merge-flag parse.
git diff --name-only quotes names with non-ASCII, quote, backslash or
newline bytes, so a protected path such as secrets/** never matched the
quoted listing and the merge went ahead. List names NUL-delimited (-z)
and match on the raw bytes.
Add a self-merge Step and tighten-only limits to a Custom process
A Step's choice replaced the child Run's Harness after the review had
been resolved against the default. When that default matched
security.harness, the review followed the Step. Resolve the review
against the Step's choice before dispatch.
Let a Custom process Step name its Harness, Model and Effort
A command could include a clear-screen sequence. check printed it, a
terminal erased the plan, and sh -c still ran the hidden command. Refuse
a control character in every string check prints. Newlines and tabs in a
command stay allowed.
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 27, 2026 15:06
Preserve Custom process terminology, subjects and Step results alongside main's Console updates. Reconcile dispatch advisory metadata and update the failed-Process Console selector for section navigation.
@JacobStephens2
JacobStephens2 merged commit 99d3662 into main Oct 27, 2026
@JacobStephens2
JacobStephens2 deleted the issue-877 branch October 27, 2026 16:00
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 27, 2026
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.

Custom processes: compose Steps from a catalogue in a file

1 participant