epicycle 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
epicycle-0.1.0/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mara Kim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: epicycle
3
+ Version: 0.1.0
4
+ Summary: Agentic development with the human outside the loop: runs a project's pinned epicycle kit.
5
+ License-Expression: MIT
6
+ Project-URL: Source, https://github.com/astralarium/epicycle
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Dynamic: license-file
11
+
12
+ # epicycle
13
+
14
+ Agentic development with the human outside the loop.
15
+
16
+ Shared agent workflow: skills, subagents, convention blocks, git hooks, the commit-message
17
+ checker and the agent git guard. A project takes a plain copy, pinned to a release.
18
+
19
+ ## Layout
20
+
21
+ | Path | Holds |
22
+ |---|---|
23
+ | `skills/`, `agents/` | skills and subagents a project takes by name |
24
+ | `blocks/` | shared text a project keeps between `<!-- epicycle:<name> -->` markers: `conventions`, `verify`, `ui-workflow`, `ui-driver` |
25
+ | `hooks/` | git hooks |
26
+ | `bin/` | `epicycle`, the agent guard and the commit checker |
27
+ | `lib/` | modules behind `bin/`, importable by project scripts |
28
+ | `pyproject.toml`, `packaging/` | the PyPI packages installing the `epicycle` command |
29
+
30
+ ## Install
31
+
32
+ Install the `epicycle` command once per machine:
33
+
34
+ ```sh
35
+ pipx install epicycle # or run it as `uvx epicycle`
36
+ ```
37
+
38
+ Inside a project holding `.epicycle/`, `epicycle` runs that pinned copy's `bin/epicycle`;
39
+ elsewhere, the newest release's. `epicycle --kit <version>` runs a given release's. `ecy` is the
40
+ short form for typing: the same command, also a package of its own.
41
+
42
+ Write `epicycle.json` at the project root (fields: the `bin/epicycle` header), then:
43
+
44
+ ```sh
45
+ epicycle install # copy the newest release into .epicycle/, link, fill the blocks, pin
46
+ git config core.hooksPath .epicycle/hooks # once per clone
47
+ .epicycle/bin/epicycle check # run in level 0 of the project's verify ladder
48
+ ```
49
+
50
+ `epicycle install` reinstalls the pinned release; `install <version>` pins another. `epicycle
51
+ check` names anything missing or out of date. Commands and options: the `bin/epicycle` header.
52
+
53
+ ## What a project provides
54
+
55
+ | Item | Where |
56
+ |---|---|
57
+ | Conventions | `AGENTS.md`, the `conventions` block (`epicycle install` adds it, creating `AGENTS.md`); a `CLAUDE.md` imports it with a line `@AGENTS.md` |
58
+ | Scope meanings, what `!` marks, attribution, pre-authorized actions | `AGENTS.md`, after the `conventions` block |
59
+ | Workflow keys | `AGENTS.md`, `## Workflow` (below) |
60
+ | Kit config | `epicycle.json` |
61
+ | Verify ladder | `.claude/skills/verify/SKILL.md`, opening with the `verify` block; a link `.agents/skills/verify` to its directory for Codex |
62
+ | UI driver, if any | a workflow skill opening with `ui-workflow` (then Driver, Launch and session, Limits) and a driver agent opening with `ui-driver` (then Tools, App notes); a Codex `.toml` agent holds its block in `developer_instructions` |
63
+ | Guard hooks and permission entries | `.claude/settings.json`, `.codex/hooks.json` |
64
+ | Hooks setup | the project's setup command: `git config core.hooksPath .epicycle/hooks` |
65
+ | Formatter ignores | skip `.epicycle/` |
66
+
67
+ Shared text sits between a pair of block markers in the project's own files; each block names
68
+ the project sections that follow it.
69
+
70
+ ## Update
71
+
72
+ In one change on a branch:
73
+
74
+ ```sh
75
+ epicycle update # move to the newest release; prints the release notes since the pin
76
+ # make the edits the release notes name
77
+ epicycle check
78
+ ```
79
+
80
+ A release is an annotated tag `vMAJOR.MINOR.PATCH`; its message, the release notes, lists the
81
+ `BREAKING CHANGE:` footers since the previous tag. After an update touching the guard, the hooks
82
+ or the agent settings, run the guard smoke test (Hooks and guard).
83
+
84
+ ## Hooks and guard
85
+
86
+ The hooks run the project's gate before each commit, hold messages to conventional commits and
87
+ refuse remote ref deletions, non-fast-forward pushes and any push to a branch `epicycle.json`
88
+ lists as `protected`. `git push --no-verify`, the user's override, skips `pre-push` and its Git
89
+ LFS upload.
90
+
91
+ The remote keeps `main`: protect it with a ruleset whose bypass list is empty, so it holds
92
+ against pushes made with the user's credentials, an agent's included. Where the remote offers
93
+ no ruleset, list `main` in `protected`.
94
+
95
+ The guard stops agent commands the hooks cannot see: in every checkout, skipping the hooks,
96
+ dropping the shared stash and merging a pull request; in the main checkout, discarding uncommitted
97
+ work. Codex runs it once you approve its hook with `/hooks`.
98
+
99
+ The guard smoke test, after setting up a machine or upgrading an agent CLI: an agent session
100
+ runs `git stash drop 'stash@{9999}'`, and the guard blocks it. Unguarded, the command only errors
101
+ that no such stash exists.
102
+
103
+ Another agent's pre-command hook calls the guard; exit 0 allows, exit 2 blocks:
104
+
105
+ ```sh
106
+ guard="$(git rev-parse --show-toplevel 2>/dev/null)/.epicycle/bin/guard-git-command"
107
+ [ -x "$guard" ] || exit 0 # a checkout without the kit runs unguarded
108
+ exec "$guard" --cwd "$PWD" -- "$1" # $1: the command about to run
109
+ ```
110
+
111
+ ## Workflow keys
112
+
113
+ `AGENTS.md` sets one `- **Key**: value` bullet per key under `## Workflow`; skills and agents
114
+ cite them as (Workflow: *Key*). A key left out takes the default.
115
+
116
+ | Key | Holds | Default |
117
+ |---|---|---|
118
+ | Models | worker and senior model | worker = Opus, senior = Fable |
119
+ | Spec | the document deciding behaviour | absent |
120
+ | Increments | the spec's units of work | absent |
121
+ | Epic preconditions | what holds before an epic starts | absent |
122
+ | Plan | where plan docs live | `plan/<nn>-<slug>.md` |
123
+ | Commit format | the commit message rules | the Git section of `AGENTS.md` |
124
+ | Branches | branch names per kind of work | `<type>/<slug>` for a change, `epic/<nn>-<slug>` for an epic |
125
+ | Worktree | creating and removing a worktree | `git worktree add` in `../<repo>.worktrees/`, one folder per branch; `git worktree remove` |
126
+ | Base check | what passes on a base before work | level 0 of the `verify` ladder |
127
+ | Gates | gates per change, milestone and close | the `verify` skill: Gate per change kind, Milestone, Close |
128
+ | Always reviewed | paths always reviewed | `.epicycle/`, `epicycle.json`, `.claude/`, `.codex/` |
129
+ | Architecture | module map and dependency rules | absent |
130
+ | Acceptance | accepted designs UI work cites | absent |
131
+ | User checks | what only the user verifies | the `verify` ladder's user levels |
132
+ | UI driver | the skill and agent driving the running app | absent |
133
+ | Design phase | the skill producing proposed designs | absent |
134
+
135
+ ## Development
136
+
137
+ `DEVELOPMENT.md`; conventions in `AGENTS.md`.
@@ -0,0 +1,126 @@
1
+ # epicycle
2
+
3
+ Agentic development with the human outside the loop.
4
+
5
+ Shared agent workflow: skills, subagents, convention blocks, git hooks, the commit-message
6
+ checker and the agent git guard. A project takes a plain copy, pinned to a release.
7
+
8
+ ## Layout
9
+
10
+ | Path | Holds |
11
+ |---|---|
12
+ | `skills/`, `agents/` | skills and subagents a project takes by name |
13
+ | `blocks/` | shared text a project keeps between `<!-- epicycle:<name> -->` markers: `conventions`, `verify`, `ui-workflow`, `ui-driver` |
14
+ | `hooks/` | git hooks |
15
+ | `bin/` | `epicycle`, the agent guard and the commit checker |
16
+ | `lib/` | modules behind `bin/`, importable by project scripts |
17
+ | `pyproject.toml`, `packaging/` | the PyPI packages installing the `epicycle` command |
18
+
19
+ ## Install
20
+
21
+ Install the `epicycle` command once per machine:
22
+
23
+ ```sh
24
+ pipx install epicycle # or run it as `uvx epicycle`
25
+ ```
26
+
27
+ Inside a project holding `.epicycle/`, `epicycle` runs that pinned copy's `bin/epicycle`;
28
+ elsewhere, the newest release's. `epicycle --kit <version>` runs a given release's. `ecy` is the
29
+ short form for typing: the same command, also a package of its own.
30
+
31
+ Write `epicycle.json` at the project root (fields: the `bin/epicycle` header), then:
32
+
33
+ ```sh
34
+ epicycle install # copy the newest release into .epicycle/, link, fill the blocks, pin
35
+ git config core.hooksPath .epicycle/hooks # once per clone
36
+ .epicycle/bin/epicycle check # run in level 0 of the project's verify ladder
37
+ ```
38
+
39
+ `epicycle install` reinstalls the pinned release; `install <version>` pins another. `epicycle
40
+ check` names anything missing or out of date. Commands and options: the `bin/epicycle` header.
41
+
42
+ ## What a project provides
43
+
44
+ | Item | Where |
45
+ |---|---|
46
+ | Conventions | `AGENTS.md`, the `conventions` block (`epicycle install` adds it, creating `AGENTS.md`); a `CLAUDE.md` imports it with a line `@AGENTS.md` |
47
+ | Scope meanings, what `!` marks, attribution, pre-authorized actions | `AGENTS.md`, after the `conventions` block |
48
+ | Workflow keys | `AGENTS.md`, `## Workflow` (below) |
49
+ | Kit config | `epicycle.json` |
50
+ | Verify ladder | `.claude/skills/verify/SKILL.md`, opening with the `verify` block; a link `.agents/skills/verify` to its directory for Codex |
51
+ | UI driver, if any | a workflow skill opening with `ui-workflow` (then Driver, Launch and session, Limits) and a driver agent opening with `ui-driver` (then Tools, App notes); a Codex `.toml` agent holds its block in `developer_instructions` |
52
+ | Guard hooks and permission entries | `.claude/settings.json`, `.codex/hooks.json` |
53
+ | Hooks setup | the project's setup command: `git config core.hooksPath .epicycle/hooks` |
54
+ | Formatter ignores | skip `.epicycle/` |
55
+
56
+ Shared text sits between a pair of block markers in the project's own files; each block names
57
+ the project sections that follow it.
58
+
59
+ ## Update
60
+
61
+ In one change on a branch:
62
+
63
+ ```sh
64
+ epicycle update # move to the newest release; prints the release notes since the pin
65
+ # make the edits the release notes name
66
+ epicycle check
67
+ ```
68
+
69
+ A release is an annotated tag `vMAJOR.MINOR.PATCH`; its message, the release notes, lists the
70
+ `BREAKING CHANGE:` footers since the previous tag. After an update touching the guard, the hooks
71
+ or the agent settings, run the guard smoke test (Hooks and guard).
72
+
73
+ ## Hooks and guard
74
+
75
+ The hooks run the project's gate before each commit, hold messages to conventional commits and
76
+ refuse remote ref deletions, non-fast-forward pushes and any push to a branch `epicycle.json`
77
+ lists as `protected`. `git push --no-verify`, the user's override, skips `pre-push` and its Git
78
+ LFS upload.
79
+
80
+ The remote keeps `main`: protect it with a ruleset whose bypass list is empty, so it holds
81
+ against pushes made with the user's credentials, an agent's included. Where the remote offers
82
+ no ruleset, list `main` in `protected`.
83
+
84
+ The guard stops agent commands the hooks cannot see: in every checkout, skipping the hooks,
85
+ dropping the shared stash and merging a pull request; in the main checkout, discarding uncommitted
86
+ work. Codex runs it once you approve its hook with `/hooks`.
87
+
88
+ The guard smoke test, after setting up a machine or upgrading an agent CLI: an agent session
89
+ runs `git stash drop 'stash@{9999}'`, and the guard blocks it. Unguarded, the command only errors
90
+ that no such stash exists.
91
+
92
+ Another agent's pre-command hook calls the guard; exit 0 allows, exit 2 blocks:
93
+
94
+ ```sh
95
+ guard="$(git rev-parse --show-toplevel 2>/dev/null)/.epicycle/bin/guard-git-command"
96
+ [ -x "$guard" ] || exit 0 # a checkout without the kit runs unguarded
97
+ exec "$guard" --cwd "$PWD" -- "$1" # $1: the command about to run
98
+ ```
99
+
100
+ ## Workflow keys
101
+
102
+ `AGENTS.md` sets one `- **Key**: value` bullet per key under `## Workflow`; skills and agents
103
+ cite them as (Workflow: *Key*). A key left out takes the default.
104
+
105
+ | Key | Holds | Default |
106
+ |---|---|---|
107
+ | Models | worker and senior model | worker = Opus, senior = Fable |
108
+ | Spec | the document deciding behaviour | absent |
109
+ | Increments | the spec's units of work | absent |
110
+ | Epic preconditions | what holds before an epic starts | absent |
111
+ | Plan | where plan docs live | `plan/<nn>-<slug>.md` |
112
+ | Commit format | the commit message rules | the Git section of `AGENTS.md` |
113
+ | Branches | branch names per kind of work | `<type>/<slug>` for a change, `epic/<nn>-<slug>` for an epic |
114
+ | Worktree | creating and removing a worktree | `git worktree add` in `../<repo>.worktrees/`, one folder per branch; `git worktree remove` |
115
+ | Base check | what passes on a base before work | level 0 of the `verify` ladder |
116
+ | Gates | gates per change, milestone and close | the `verify` skill: Gate per change kind, Milestone, Close |
117
+ | Always reviewed | paths always reviewed | `.epicycle/`, `epicycle.json`, `.claude/`, `.codex/` |
118
+ | Architecture | module map and dependency rules | absent |
119
+ | Acceptance | accepted designs UI work cites | absent |
120
+ | User checks | what only the user verifies | the `verify` ladder's user levels |
121
+ | UI driver | the skill and agent driving the running app | absent |
122
+ | Design phase | the skill producing proposed designs | absent |
123
+
124
+ ## Development
125
+
126
+ `DEVELOPMENT.md`; conventions in `AGENTS.md`.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: epicycle
3
+ Version: 0.1.0
4
+ Summary: Agentic development with the human outside the loop: runs a project's pinned epicycle kit.
5
+ License-Expression: MIT
6
+ Project-URL: Source, https://github.com/astralarium/epicycle
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Dynamic: license-file
11
+
12
+ # epicycle
13
+
14
+ Agentic development with the human outside the loop.
15
+
16
+ Shared agent workflow: skills, subagents, convention blocks, git hooks, the commit-message
17
+ checker and the agent git guard. A project takes a plain copy, pinned to a release.
18
+
19
+ ## Layout
20
+
21
+ | Path | Holds |
22
+ |---|---|
23
+ | `skills/`, `agents/` | skills and subagents a project takes by name |
24
+ | `blocks/` | shared text a project keeps between `<!-- epicycle:<name> -->` markers: `conventions`, `verify`, `ui-workflow`, `ui-driver` |
25
+ | `hooks/` | git hooks |
26
+ | `bin/` | `epicycle`, the agent guard and the commit checker |
27
+ | `lib/` | modules behind `bin/`, importable by project scripts |
28
+ | `pyproject.toml`, `packaging/` | the PyPI packages installing the `epicycle` command |
29
+
30
+ ## Install
31
+
32
+ Install the `epicycle` command once per machine:
33
+
34
+ ```sh
35
+ pipx install epicycle # or run it as `uvx epicycle`
36
+ ```
37
+
38
+ Inside a project holding `.epicycle/`, `epicycle` runs that pinned copy's `bin/epicycle`;
39
+ elsewhere, the newest release's. `epicycle --kit <version>` runs a given release's. `ecy` is the
40
+ short form for typing: the same command, also a package of its own.
41
+
42
+ Write `epicycle.json` at the project root (fields: the `bin/epicycle` header), then:
43
+
44
+ ```sh
45
+ epicycle install # copy the newest release into .epicycle/, link, fill the blocks, pin
46
+ git config core.hooksPath .epicycle/hooks # once per clone
47
+ .epicycle/bin/epicycle check # run in level 0 of the project's verify ladder
48
+ ```
49
+
50
+ `epicycle install` reinstalls the pinned release; `install <version>` pins another. `epicycle
51
+ check` names anything missing or out of date. Commands and options: the `bin/epicycle` header.
52
+
53
+ ## What a project provides
54
+
55
+ | Item | Where |
56
+ |---|---|
57
+ | Conventions | `AGENTS.md`, the `conventions` block (`epicycle install` adds it, creating `AGENTS.md`); a `CLAUDE.md` imports it with a line `@AGENTS.md` |
58
+ | Scope meanings, what `!` marks, attribution, pre-authorized actions | `AGENTS.md`, after the `conventions` block |
59
+ | Workflow keys | `AGENTS.md`, `## Workflow` (below) |
60
+ | Kit config | `epicycle.json` |
61
+ | Verify ladder | `.claude/skills/verify/SKILL.md`, opening with the `verify` block; a link `.agents/skills/verify` to its directory for Codex |
62
+ | UI driver, if any | a workflow skill opening with `ui-workflow` (then Driver, Launch and session, Limits) and a driver agent opening with `ui-driver` (then Tools, App notes); a Codex `.toml` agent holds its block in `developer_instructions` |
63
+ | Guard hooks and permission entries | `.claude/settings.json`, `.codex/hooks.json` |
64
+ | Hooks setup | the project's setup command: `git config core.hooksPath .epicycle/hooks` |
65
+ | Formatter ignores | skip `.epicycle/` |
66
+
67
+ Shared text sits between a pair of block markers in the project's own files; each block names
68
+ the project sections that follow it.
69
+
70
+ ## Update
71
+
72
+ In one change on a branch:
73
+
74
+ ```sh
75
+ epicycle update # move to the newest release; prints the release notes since the pin
76
+ # make the edits the release notes name
77
+ epicycle check
78
+ ```
79
+
80
+ A release is an annotated tag `vMAJOR.MINOR.PATCH`; its message, the release notes, lists the
81
+ `BREAKING CHANGE:` footers since the previous tag. After an update touching the guard, the hooks
82
+ or the agent settings, run the guard smoke test (Hooks and guard).
83
+
84
+ ## Hooks and guard
85
+
86
+ The hooks run the project's gate before each commit, hold messages to conventional commits and
87
+ refuse remote ref deletions, non-fast-forward pushes and any push to a branch `epicycle.json`
88
+ lists as `protected`. `git push --no-verify`, the user's override, skips `pre-push` and its Git
89
+ LFS upload.
90
+
91
+ The remote keeps `main`: protect it with a ruleset whose bypass list is empty, so it holds
92
+ against pushes made with the user's credentials, an agent's included. Where the remote offers
93
+ no ruleset, list `main` in `protected`.
94
+
95
+ The guard stops agent commands the hooks cannot see: in every checkout, skipping the hooks,
96
+ dropping the shared stash and merging a pull request; in the main checkout, discarding uncommitted
97
+ work. Codex runs it once you approve its hook with `/hooks`.
98
+
99
+ The guard smoke test, after setting up a machine or upgrading an agent CLI: an agent session
100
+ runs `git stash drop 'stash@{9999}'`, and the guard blocks it. Unguarded, the command only errors
101
+ that no such stash exists.
102
+
103
+ Another agent's pre-command hook calls the guard; exit 0 allows, exit 2 blocks:
104
+
105
+ ```sh
106
+ guard="$(git rev-parse --show-toplevel 2>/dev/null)/.epicycle/bin/guard-git-command"
107
+ [ -x "$guard" ] || exit 0 # a checkout without the kit runs unguarded
108
+ exec "$guard" --cwd "$PWD" -- "$1" # $1: the command about to run
109
+ ```
110
+
111
+ ## Workflow keys
112
+
113
+ `AGENTS.md` sets one `- **Key**: value` bullet per key under `## Workflow`; skills and agents
114
+ cite them as (Workflow: *Key*). A key left out takes the default.
115
+
116
+ | Key | Holds | Default |
117
+ |---|---|---|
118
+ | Models | worker and senior model | worker = Opus, senior = Fable |
119
+ | Spec | the document deciding behaviour | absent |
120
+ | Increments | the spec's units of work | absent |
121
+ | Epic preconditions | what holds before an epic starts | absent |
122
+ | Plan | where plan docs live | `plan/<nn>-<slug>.md` |
123
+ | Commit format | the commit message rules | the Git section of `AGENTS.md` |
124
+ | Branches | branch names per kind of work | `<type>/<slug>` for a change, `epic/<nn>-<slug>` for an epic |
125
+ | Worktree | creating and removing a worktree | `git worktree add` in `../<repo>.worktrees/`, one folder per branch; `git worktree remove` |
126
+ | Base check | what passes on a base before work | level 0 of the `verify` ladder |
127
+ | Gates | gates per change, milestone and close | the `verify` skill: Gate per change kind, Milestone, Close |
128
+ | Always reviewed | paths always reviewed | `.epicycle/`, `epicycle.json`, `.claude/`, `.codex/` |
129
+ | Architecture | module map and dependency rules | absent |
130
+ | Acceptance | accepted designs UI work cites | absent |
131
+ | User checks | what only the user verifies | the `verify` ladder's user levels |
132
+ | UI driver | the skill and agent driving the running app | absent |
133
+ | Design phase | the skill producing proposed designs | absent |
134
+
135
+ ## Development
136
+
137
+ `DEVELOPMENT.md`; conventions in `AGENTS.md`.
@@ -0,0 +1,11 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ packaging/epicycle_bootstrap.py
5
+ packaging/epicycle.egg-info/PKG-INFO
6
+ packaging/epicycle.egg-info/SOURCES.txt
7
+ packaging/epicycle.egg-info/dependency_links.txt
8
+ packaging/epicycle.egg-info/entry_points.txt
9
+ packaging/epicycle.egg-info/scm_file_list.json
10
+ packaging/epicycle.egg-info/scm_version.json
11
+ packaging/epicycle.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ ecy = epicycle_bootstrap:main
3
+ epicycle = epicycle_bootstrap:main
@@ -0,0 +1,114 @@
1
+ {
2
+ "files": [
3
+ ".agents/skills/deliver",
4
+ ".agents/skills/verify",
5
+ ".claude/agents/implementer.md",
6
+ ".claude/agents/reviewer.md",
7
+ ".claude/settings.json",
8
+ ".claude/skills/deliver",
9
+ ".claude/skills/verify",
10
+ ".codex/hooks.json",
11
+ ".epicycle",
12
+ ".github/workflows/release.yml",
13
+ ".gitignore",
14
+ "AGENTS.md",
15
+ "CLAUDE.md",
16
+ "DEVELOPMENT.md",
17
+ "LICENSE",
18
+ "MANIFEST.in",
19
+ "README.md",
20
+ "agents/implementer.md",
21
+ "agents/reviewer.md",
22
+ "bin/check-commit-message",
23
+ "bin/epicycle",
24
+ "bin/guard-git-command",
25
+ "blocks/conventions.md",
26
+ "blocks/ui-driver.md",
27
+ "blocks/ui-workflow.md",
28
+ "blocks/verify.md",
29
+ "check",
30
+ "docs/skills/verify/SKILL.md",
31
+ "epicycle.json",
32
+ "hooks/commit-msg",
33
+ "hooks/post-checkout",
34
+ "hooks/post-commit",
35
+ "hooks/post-merge",
36
+ "hooks/pre-commit",
37
+ "hooks/pre-push",
38
+ "lib/.gitignore",
39
+ "lib/epicycle/__init__.py",
40
+ "lib/epicycle/commit_message.py",
41
+ "lib/epicycle/config.py",
42
+ "lib/epicycle/gate.py",
43
+ "lib/epicycle/guard.py",
44
+ "lib/epicycle/hooks.py",
45
+ "packaging/ecy/LICENSE",
46
+ "packaging/ecy/README.md",
47
+ "packaging/ecy/pyproject.toml",
48
+ "packaging/ecy/setup.py",
49
+ "packaging/epicycle_bootstrap.py",
50
+ "pyproject.toml",
51
+ "scripts/release",
52
+ "skills/deliver/SKILL.md",
53
+ "tests/fixtures/bootstrap/epicycle",
54
+ "tests/fixtures/consumers/consumer-subset/.claude/settings.json",
55
+ "tests/fixtures/consumers/consumer-subset/.codex/hooks.json",
56
+ "tests/fixtures/consumers/consumer-subset/AGENTS.md",
57
+ "tests/fixtures/consumers/consumer-subset/epicycle.json",
58
+ "tests/fixtures/consumers/consumer/.claude/settings.json",
59
+ "tests/fixtures/consumers/consumer/.codex/hooks.json",
60
+ "tests/fixtures/consumers/consumer/AGENTS.md",
61
+ "tests/fixtures/consumers/consumer/CLAUDE.md",
62
+ "tests/fixtures/consumers/consumer/Kit/README.md",
63
+ "tests/fixtures/consumers/consumer/epicycle.json",
64
+ "tests/fixtures/consumers/consumer/scripts/kit-rules",
65
+ "tests/fixtures/conventions/leading-tool-block/AGENTS.md",
66
+ "tests/fixtures/conventions/models-in-claude-md/AGENTS.md",
67
+ "tests/fixtures/conventions/models-in-claude-md/CLAUDE.md",
68
+ "tests/fixtures/conventions/titled-with-workflow/AGENTS.md",
69
+ "tests/fixtures/conventions/titled/AGENTS.md",
70
+ "tests/fixtures/conventions/untitled/AGENTS.md",
71
+ "tests/fixtures/epicycle.json",
72
+ "tests/fixtures/guard/claude-pretooluse.json",
73
+ "tests/fixtures/kit-update.remove",
74
+ "tests/fixtures/kit-update/blocks/block-one.md",
75
+ "tests/fixtures/kit-update/hooks/pre-commit",
76
+ "tests/fixtures/kit-update/hooks/pre-push",
77
+ "tests/fixtures/kit-update/lib/kit_rules.py",
78
+ "tests/fixtures/kit-update/skills/skill-one/reference.md",
79
+ "tests/fixtures/kit/agents/agent-one.md",
80
+ "tests/fixtures/kit/agents/agent-two.md",
81
+ "tests/fixtures/kit/bin/guard-git-command",
82
+ "tests/fixtures/kit/blocks/block-one.md",
83
+ "tests/fixtures/kit/blocks/block-two.md",
84
+ "tests/fixtures/kit/hooks/commit-msg",
85
+ "tests/fixtures/kit/hooks/post-checkout",
86
+ "tests/fixtures/kit/hooks/pre-commit",
87
+ "tests/fixtures/kit/lib/.gitignore",
88
+ "tests/fixtures/kit/lib/kit_rules.py",
89
+ "tests/fixtures/kit/skills/skill-one/SKILL.md",
90
+ "tests/fixtures/kit/skills/skill-three/SKILL.md",
91
+ "tests/fixtures/kit/skills/skill-two/SKILL.md",
92
+ "tests/fixtures/kit/skills/skill-two/notes.md",
93
+ "tests/fixtures/release/check",
94
+ "tests/fixtures/ui-driver/browser/AGENTS.md",
95
+ "tests/fixtures/ui-driver/browser/docs/agents/browser-driver.md",
96
+ "tests/fixtures/ui-driver/browser/docs/agents/browser-driver.toml",
97
+ "tests/fixtures/ui-driver/browser/docs/skills/browser-workflow/SKILL.md",
98
+ "tests/fixtures/ui-driver/simulator/AGENTS.md",
99
+ "tests/fixtures/ui-driver/simulator/docs/agents/simulator-driver.md",
100
+ "tests/fixtures/ui-driver/simulator/docs/skills/simulator-workflow/SKILL.md",
101
+ "tests/test-distribution",
102
+ "tests/test_bootstrap.py",
103
+ "tests/test_commit_message.py",
104
+ "tests/test_conventions.py",
105
+ "tests/test_deliver.py",
106
+ "tests/test_epicycle.py",
107
+ "tests/test_guard.py",
108
+ "tests/test_hooks.py",
109
+ "tests/test_release.py",
110
+ "tests/test_self_consumption.py",
111
+ "tests/test_ui_driver.py",
112
+ "tests/test_workflow_citations.py"
113
+ ]
114
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.1.0",
3
+ "distance": 0,
4
+ "node": "g3390121013a103046be3cb2105811f6e979edd5e",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-12-03"
8
+ }
@@ -0,0 +1 @@
1
+ epicycle_bootstrap
@@ -0,0 +1,225 @@
1
+ """The installed `epicycle` command: runs the kit's `bin/epicycle` with the given arguments.
2
+
3
+ Usage: epicycle [--kit <version>] <command> [<arguments>] (`ecy` is the same command)
4
+
5
+ Inside a checkout holding `.epicycle/`, runs that copy's `bin/epicycle`, the pinned version.
6
+ Elsewhere, and for `clone` and `convert` everywhere, runs the `bin/epicycle` of the newest
7
+ release on the kit's remote. `--kit <version>` runs that release's instead, everywhere.
8
+ A release is a tag vMAJOR.MINOR.PATCH; a <version> of 1.2.3 names v1.2.3.
9
+
10
+ Environment: EPICYCLE_REMOTE (git URL of the kit), EPICYCLE_ARCHIVE (archive URL with
11
+ {commit}), EPICYCLE_CACHE (archive cache directory), as `bin/epicycle` reads them.
12
+ """
13
+
14
+ import contextlib
15
+ import hashlib
16
+ import io
17
+ import os
18
+ import re
19
+ import shutil
20
+ import subprocess
21
+ import sys
22
+ import tarfile
23
+ import tempfile
24
+ import urllib.error
25
+ import urllib.request
26
+ from pathlib import Path
27
+
28
+ REMOTE = "https://github.com/astralarium/epicycle.git"
29
+ ARCHIVE = "https://github.com/astralarium/epicycle/archive/{commit}.tar.gz"
30
+ KIT_DIR = ".epicycle"
31
+ COMMAND = "bin/epicycle"
32
+ # The kit files `bin/epicycle` runs with, as its hand-off copies them.
33
+ TAKEN = ("bin/", "lib/")
34
+ # Commands the newest kit runs, inside a checkout too.
35
+ NEWEST_KIT = ("clone", "convert")
36
+ RELEASE = re.compile(r"v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)")
37
+ COMMIT = re.compile(r"[0-9a-f]{40}")
38
+
39
+
40
+ class Failure(Exception):
41
+ """A refusal with its reason; the command exits 1."""
42
+
43
+
44
+ def git(*args):
45
+ return subprocess.run(["git", *args], capture_output=True, text=True)
46
+
47
+
48
+ def pinned_command():
49
+ """The checkout's `.epicycle/bin/epicycle`, if the current directory is in one holding it."""
50
+ run = git("rev-parse", "--show-toplevel")
51
+ if run.returncode != 0 or not run.stdout.strip():
52
+ return None
53
+ command = Path(run.stdout.strip()) / KIT_DIR / COMMAND
54
+ return command if command.is_file() else None
55
+
56
+
57
+ def release_key(version):
58
+ return tuple(int(part) for part in RELEASE.fullmatch(version).groups())
59
+
60
+
61
+ class Releases:
62
+ """The kit remote's release tags and commit archives, cached as `bin/epicycle` caches them."""
63
+
64
+ def __init__(self):
65
+ self.remote = os.environ.get("EPICYCLE_REMOTE") or REMOTE
66
+ self.archive = os.environ.get("EPICYCLE_ARCHIVE") or ARCHIVE
67
+ cache = os.environ.get("EPICYCLE_CACHE")
68
+ base = os.environ.get("XDG_CACHE_HOME") or os.path.join(os.path.expanduser("~"), ".cache")
69
+ self.cache = Path(cache) if cache else Path(base) / "epicycle"
70
+
71
+ def tags(self, *patterns):
72
+ """{version: commit} of the remote's release tags matching patterns, annotated tags peeled."""
73
+ run = git("ls-remote", "--tags", self.remote, *patterns)
74
+ if run.returncode != 0:
75
+ raise Failure(f"cannot list the tags of {self.remote}: {run.stderr.strip()}")
76
+ refs = dict(reversed(line.split("\t")) for line in run.stdout.splitlines() if "\t" in line)
77
+ tags = {ref[len("refs/tags/"):]: refs.get(f"{ref}^{{}}", sha)
78
+ for ref, sha in refs.items() if not ref.endswith("^{}")}
79
+ return {version: commit for version, commit in tags.items() if RELEASE.fullmatch(version)}
80
+
81
+ def newest(self):
82
+ tags = self.tags("refs/tags/v*")
83
+ if not tags:
84
+ raise Failure(f"{self.remote} has no release (vMAJOR.MINOR.PATCH tag)")
85
+ version = max(tags, key=release_key)
86
+ self.store(self.tag_entry(version), tags[version].encode())
87
+ return tags[version]
88
+
89
+ def tag_entry(self, version):
90
+ return f"{hashlib.sha256(self.remote.encode()).hexdigest()[:16]}-{version}.commit"
91
+
92
+ def resolve(self, version):
93
+ """The commit of a release, from the cache once listed."""
94
+ name = self.tag_entry(version)
95
+ try:
96
+ commit = (self.cache / name).read_text(encoding="utf-8").strip()
97
+ except (OSError, UnicodeDecodeError):
98
+ commit = ""
99
+ if COMMIT.fullmatch(commit):
100
+ return commit
101
+ tag = f"refs/tags/{version}"
102
+ commit = self.tags(tag, f"{tag}^{{}}").get(version)
103
+ if not commit:
104
+ raise Failure(f"{self.remote} has no tag {version}")
105
+ self.store(name, commit.encode())
106
+ return commit
107
+
108
+ def files(self, commit):
109
+ """The kit files of a commit's archive; a cached archive that fails to read is downloaded
110
+ again, and a download is cached once it reads."""
111
+ path = self.cache / f"{commit}.tar.gz"
112
+ if path.is_file():
113
+ try:
114
+ return read_archive(path.read_bytes(), commit)
115
+ except (Failure, OSError):
116
+ with contextlib.suppress(OSError):
117
+ path.unlink()
118
+ url = self.archive.format(commit=commit)
119
+ try:
120
+ with urllib.request.urlopen(url, timeout=120) as response:
121
+ data = response.read()
122
+ except (urllib.error.URLError, OSError, ValueError) as error:
123
+ raise Failure(f"cannot download {url}: {error}")
124
+ files = read_archive(data, commit)
125
+ self.store(f"{commit}.tar.gz", data)
126
+ return files
127
+
128
+ def store(self, name, data):
129
+ """Writes a cache entry; a cache that cannot take it only costs a later download."""
130
+ tmp = None
131
+ try:
132
+ self.cache.mkdir(parents=True, exist_ok=True)
133
+ fd, tmp = tempfile.mkstemp(dir=self.cache, prefix=f".{name}.")
134
+ with os.fdopen(fd, "wb") as f:
135
+ f.write(data)
136
+ os.replace(tmp, self.cache / name)
137
+ except OSError:
138
+ if tmp and os.path.exists(tmp):
139
+ os.unlink(tmp)
140
+
141
+
142
+ def read_archive(data, commit):
143
+ """{kit path: (executable, bytes)} of the `bin/` and `lib/` files in a commit archive, its top
144
+ directory dropped."""
145
+ files = {}
146
+ try:
147
+ with tarfile.open(fileobj=io.BytesIO(data), mode="r:*") as tar:
148
+ for member in tar:
149
+ parts = member.name.split("/")[1:]
150
+ if not parts or parts == [""] or member.isdir():
151
+ continue
152
+ if any(p in ("", ".", "..") for p in parts) or member.name.startswith("/"):
153
+ raise Failure(f"archive of {commit[:12]} holds an unsafe path: {member.name}")
154
+ path = "/".join(parts)
155
+ if member.isreg() and path.startswith(TAKEN):
156
+ files[path] = (bool(member.mode & 0o100), tar.extractfile(member).read())
157
+ stamped = tar.pax_headers.get("comment")
158
+ except tarfile.TarError as error:
159
+ raise Failure(f"archive of {commit[:12]} is unreadable: {error}")
160
+ if stamped and stamped != commit:
161
+ raise Failure(f"archive for {commit[:12]} holds commit {stamped[:12]}")
162
+ if COMMAND not in files:
163
+ raise Failure(f"the kit at {commit[:12]} holds no {COMMAND}")
164
+ return files
165
+
166
+
167
+ def run_release(version, arguments):
168
+ """Runs a release's `bin/epicycle`, the newest for version None, from a temporary copy."""
169
+ releases = Releases()
170
+ commit = releases.resolve(version) if version else releases.newest()
171
+ files = releases.files(commit)
172
+ scratch = Path(tempfile.mkdtemp(prefix="epicycle-kit."))
173
+ try:
174
+ for path, (executable, data) in files.items():
175
+ target = scratch / path
176
+ target.parent.mkdir(parents=True, exist_ok=True)
177
+ target.write_bytes(data)
178
+ target.chmod(0o755 if executable else 0o644)
179
+ code = subprocess.run([str(scratch / COMMAND), *arguments]).returncode
180
+ return 128 - code if code < 0 else code # a signal's exit code, as a shell reports it
181
+ finally:
182
+ shutil.rmtree(scratch, ignore_errors=True)
183
+
184
+
185
+ def split_kit(argv):
186
+ """(the --kit version or None, the remaining arguments); --kit leads the arguments."""
187
+ if argv[:1] == ["--kit"]:
188
+ if len(argv) < 2:
189
+ raise Failure("--kit takes a version")
190
+ version, rest = argv[1], argv[2:]
191
+ elif argv[:1] and argv[0].startswith("--kit="):
192
+ version, rest = argv[0][len("--kit="):], argv[1:]
193
+ else:
194
+ return None, argv
195
+ version = version if version.startswith("v") else f"v{version}"
196
+ if not RELEASE.fullmatch(version):
197
+ raise Failure(f"--kit {version} is not a release version (MAJOR.MINOR.PATCH)")
198
+ return version, rest
199
+
200
+
201
+ def main(argv=None):
202
+ argv = sys.argv[1:] if argv is None else argv
203
+ try:
204
+ version, arguments = split_kit(argv)
205
+ newest_kit = bool(arguments) and arguments[0] in NEWEST_KIT
206
+ pinned = None if version or newest_kit else pinned_command()
207
+ if pinned:
208
+ try:
209
+ os.execv(str(pinned), [str(pinned), *arguments])
210
+ except OSError as error:
211
+ raise Failure(f"cannot run {pinned}: {error.strerror}")
212
+ return run_release(version, arguments)
213
+ except Failure as error:
214
+ print(f"epicycle: {error}", file=sys.stderr)
215
+ return 1
216
+ except OSError as error: # git missing, a temporary copy failing to write
217
+ where = f": {error.filename}" if error.filename else ""
218
+ print(f"epicycle: {error.strerror or error}{where}", file=sys.stderr)
219
+ return 1
220
+ except KeyboardInterrupt:
221
+ return 130
222
+
223
+
224
+ if __name__ == "__main__":
225
+ sys.exit(main())
@@ -0,0 +1,28 @@
1
+ # The `epicycle` package: the `epicycle` and `ecy` commands (packaging/epicycle_bootstrap.py),
2
+ # at the version of the release tag it builds from.
3
+
4
+ [build-system]
5
+ requires = ["setuptools>=77", "setuptools-scm>=8"]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "epicycle"
10
+ dynamic = ["version"]
11
+ description = "Agentic development with the human outside the loop: runs a project's pinned epicycle kit."
12
+ readme = "README.md"
13
+ license = "MIT"
14
+ license-files = ["LICENSE"]
15
+ requires-python = ">=3.9"
16
+
17
+ [project.urls]
18
+ Source = "https://github.com/astralarium/epicycle"
19
+
20
+ [project.scripts]
21
+ epicycle = "epicycle_bootstrap:main"
22
+ ecy = "epicycle_bootstrap:main"
23
+
24
+ [tool.setuptools]
25
+ package-dir = { "" = "packaging" }
26
+ py-modules = ["epicycle_bootstrap"]
27
+
28
+ [tool.setuptools_scm]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+