singleton-pipeline 0.4.0-beta.11 → 0.4.0-beta.13
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.
- package/CHANGELOG.md +49 -0
- package/README.md +170 -129
- package/docs/reference.md +63 -18
- package/package.json +2 -1
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/commands/new.js +455 -109
- package/packages/cli/src/commands/repl.js +86 -89
- package/packages/cli/src/executor/debug-loop.js +587 -0
- package/packages/cli/src/executor/inputs.js +202 -0
- package/packages/cli/src/executor/outputs.js +140 -0
- package/packages/cli/src/executor/preflight.js +459 -0
- package/packages/cli/src/executor/replay-loop.js +172 -0
- package/packages/cli/src/executor/run-report.js +189 -0
- package/packages/cli/src/executor/run-setup.js +93 -0
- package/packages/cli/src/executor/security-review.js +108 -0
- package/packages/cli/src/executor/snapshot-manager.js +335 -0
- package/packages/cli/src/executor/step-runner.js +266 -0
- package/packages/cli/src/executor.js +233 -2233
- package/packages/cli/src/index.js +1 -1
- package/packages/cli/src/runners/copilot.js +20 -22
- package/packages/cli/src/shell.js +244 -54
- package/packages/cli/src/timeline.js +54 -20
- package/packages/server/package.json +1 -1
- package/packages/web/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable beta changes for Singleton Pipeline Builder.
|
|
4
|
+
|
|
5
|
+
## 0.4.0-beta.12
|
|
6
|
+
|
|
7
|
+
This beta hardens local execution and turns the CLI executor from one large script into smaller, testable runtime modules.
|
|
8
|
+
|
|
9
|
+
- Fresh clones now include the Markdown agent fixtures used by the CLI test suite.
|
|
10
|
+
- `/new` now opens a sectioned in-shell agent form instead of a raw prompt chain, with field autocomplete, ghost defaults, `:back`, `:dir`, `:cancel`, review, and overwrite confirmation.
|
|
11
|
+
- The REPL gained prompt-scoped completers and passive `/run <pipeline>` flag suggestions, so pipeline runs and agent creation stay inside the same terminal UI.
|
|
12
|
+
- User-provided `$INPUT`, `$FILE`, and `$PIPE` content is XML-escaped before being embedded in prompts, so files cannot inject fake `<security_policy>`, `<workspace>`, or output tags.
|
|
13
|
+
- Replay rollback is now explicit: debug review shows snapshot coverage, replay restores touched project files before editing inputs, and skipped files are reported loudly.
|
|
14
|
+
- The executor has been split into focused modules under `packages/cli/src/executor/`: `inputs`, `outputs`, `snapshot-manager`, `preflight`, `debug-loop`, `step-runner`, `run-report`, `security-review`, `run-setup`, and `replay-loop`.
|
|
15
|
+
- `executor.js` now orchestrates the run instead of owning every detail inline; the file dropped from roughly 2,600+ lines to about 660 lines.
|
|
16
|
+
- Run reporting is cleaner: manifests and terminal summaries are generated from `run-report.js`, debug review labels include the active step, and the CLI summary keeps high-signal fields visible while the full details stay in `run-manifest.json`.
|
|
17
|
+
- The terminal UI now uses semantic color tokens, framed run panels, step labels, mirrored pipeline logs, compact debug choices, syntax-colored diffs, and status-focused summary tables.
|
|
18
|
+
- Copilot output handling is quieter and more deterministic: Singleton passes prompts through the CLI argument expected by Copilot and keeps the final assistant message instead of intermediate narration.
|
|
19
|
+
- Copilot, OpenCode, Claude, and Codex share the same `security_profile` model, with deterministic post-run validation as the final enforcement layer.
|
|
20
|
+
- Test coverage is up to 110 tests across 12 files.
|
|
21
|
+
|
|
22
|
+
## 0.3.0-beta
|
|
23
|
+
|
|
24
|
+
This beta focused on multi-provider execution, Copilot support, inspection, and safer local runs.
|
|
25
|
+
|
|
26
|
+
- Claude, Codex, Copilot, and experimental OpenCode can now run from the same pipeline model.
|
|
27
|
+
- Copilot support uses the local `copilot` CLI with optional `runner_agent`.
|
|
28
|
+
- Copilot tool permissions are generated from Singleton security profiles using `--allow-tool` and `--deny-tool`.
|
|
29
|
+
- Repo-level Copilot profiles in `.github/agents/*.agent.md` are optional; user-level and organization-level agents can also be used.
|
|
30
|
+
- OpenCode support uses the local `opencode` CLI with optional `runner_agent`; Singleton maps security profiles to OpenCode native permissions through runtime config.
|
|
31
|
+
- `Policy` is now visible during runs and in the final recap.
|
|
32
|
+
- Agents can run as `read-only`, `workspace-write`, `restricted-write`, or `dangerous`.
|
|
33
|
+
- Pipelines can restrict writers to exact files or folders with `allowed_paths`.
|
|
34
|
+
- `.singleton/security.json` defines project-wide defaults, blocked paths, and commit exclusions.
|
|
35
|
+
- Singleton validates writes before execution, at write-time, and after each step by checking real project changes.
|
|
36
|
+
- Security violations pause the REPL with `continue`, `stop`, and `diff` options.
|
|
37
|
+
- `--debug` pauses before each step with `continue`, `inspect`, `edit`, `skip`, and `abort`.
|
|
38
|
+
- Debug also pauses after each step to inspect parsed outputs, written files, detected changes, and diffs before continuing.
|
|
39
|
+
- Debug inspect shows the full prompt that will be sent to the provider.
|
|
40
|
+
- Debug edit lets you override resolved step inputs for the current run only.
|
|
41
|
+
- Debug replay can rerun a step with adjusted inputs; project file changes from the previous attempt are restored first.
|
|
42
|
+
- Debug replay stores repeated step artifacts under `attempt-1`, `attempt-2`, etc.; steps without replay keep artifacts at the step root.
|
|
43
|
+
- Debug replay is capped per step and only restores detected project file changes, not external side effects.
|
|
44
|
+
- Edited inputs are marked in prompt preview with `debug-edited="true"` to make prompt priority easier to inspect.
|
|
45
|
+
- Debug decisions are recorded in `run-manifest.json` as lightweight `debugEvents`.
|
|
46
|
+
- Debug runs are stored with a `DEBUG-` prefix in `.singleton/runs/`.
|
|
47
|
+
- Raw provider output can be inspected during debug and is saved as `raw-output.md` when structured output parsing fails or debug detects output warnings.
|
|
48
|
+
- Run manifests are written even when a pipeline fails, so partial runs remain inspectable.
|
|
49
|
+
- `/commit-last` previews files, applies security exclusions, and asks for confirmation.
|
package/README.md
CHANGED
|
@@ -1,212 +1,253 @@
|
|
|
1
|
-
# Singleton Pipeline Builder
|
|
1
|
+
# Singleton Pipeline Builder
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/singleton-pipeline)
|
|
4
4
|
[](https://www.npmjs.com/package/singleton-pipeline)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
Build multi-agent pipelines for your codebase
|
|
7
|
+
Build and run multi-agent pipelines for your codebase.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Singleton turns the workflow you already do by hand with Claude, Codex, Copilot, or OpenCode into a reusable project-local pipeline: one agent scouts, another writes, another reviews, and the run leaves behind a manifest of what changed.
|
|
10
10
|
|
|
11
11
|
- agents are plain Markdown files
|
|
12
|
-
- pipelines are JSON
|
|
13
|
-
- runs are
|
|
14
|
-
-
|
|
12
|
+
- pipelines are JSON files under `.singleton/pipelines`
|
|
13
|
+
- runs are stored under `.singleton/runs`
|
|
14
|
+
- execution is local orchestration over provider CLIs in your `$PATH`
|
|
15
|
+
- write policy is enforced by Singleton before and after each step
|
|
15
16
|
|
|
16
17
|
> Status: beta. Singleton is usable locally, but the pipeline format, provider adapters, and builder UX may still evolve.
|
|
17
18
|
|
|
18
|
-
## Version 0.4.0 Beta
|
|
19
|
-
|
|
20
|
-
This beta uniformizes the four runners around a single security model and adds the deterministic post-run validation layer.
|
|
21
|
-
|
|
22
|
-
- All four runners (Claude Code, Codex, Copilot, OpenCode) accept a `security_profile` parameter and translate it to their native CLI flags through a dedicated, unit-tested builder (`buildClaudePermissionArgs`, `buildCodexSandboxArgs`, `buildCopilotPermissionArgs`, `buildOpenCodePermissionConfig`).
|
|
23
|
-
- Codex now honors the four profiles via `--sandbox` modes (`read-only`, `workspace-write`, `danger-full-access`) instead of a hardcoded `workspace-write`.
|
|
24
|
-
- Claude now maps profiles to `--permission-mode` and `--disallowedTools` instead of relying on the legacy `permission_mode`; the legacy escape hatch is preserved.
|
|
25
|
-
- Layer 3 (post-run snapshot diff) is now covered by a dedicated test suite that exercises out-of-bounds writes, blocked-path patterns, `../` traversal, and read-only enforcement without any LLM in the loop.
|
|
26
|
-
- `assertWriteAllowed` is unit-tested as the atomic security predicate (11 cases) in `security/policy.test.js`.
|
|
27
|
-
- Preflight now emits explicit info/warning messages for each provider × profile combination, calling out when Singleton relies on Layer 3 because a runner has no per-path filter.
|
|
28
|
-
- Shared runner helpers (`safeJsonParse`, `extractText`, `findUsage`, `findCostUsd`) factored into `runners/_shared.js`; ~120 lines of duplicated parsing logic removed.
|
|
29
|
-
- OpenCode auth fix: Singleton no longer redirects `XDG_DATA_HOME`, which used to strip provider credentials from the spawned process. Permission isolation now relies exclusively on `OPENCODE_CONFIG_CONTENT`.
|
|
30
|
-
- A `Security model` section in this README describes the three layers and their per-runner coverage.
|
|
31
|
-
- Test count grew from 52 to 96 across the uniformization work.
|
|
32
|
-
|
|
33
|
-
## Version 0.3.0 Beta
|
|
34
|
-
|
|
35
|
-
This beta focused on multi-provider execution, Copilot support, inspection, and safer local runs.
|
|
36
|
-
|
|
37
|
-
- Claude, Codex, Copilot, and experimental OpenCode can now run from the same pipeline model.
|
|
38
|
-
- Copilot support uses the local `copilot` CLI with optional `runner_agent`.
|
|
39
|
-
- Copilot tool permissions are generated from Singleton security profiles using `--allow-tool` and `--deny-tool`.
|
|
40
|
-
- Repo-level Copilot profiles in `.github/agents/*.agent.md` are optional; user-level and organization-level agents can also be used.
|
|
41
|
-
- OpenCode support uses the local `opencode` CLI with optional `runner_agent`; Singleton maps security profiles to OpenCode native permissions through runtime config.
|
|
42
|
-
- `Policy` is now visible during runs and in the final recap.
|
|
43
|
-
- Agents can run as `read-only`, `workspace-write`, `restricted-write`, or `dangerous`.
|
|
44
|
-
- Pipelines can restrict writers to exact files or folders with `allowed_paths`.
|
|
45
|
-
- `.singleton/security.json` defines project-wide defaults, blocked paths, and commit exclusions.
|
|
46
|
-
- Singleton validates writes before execution, at write-time, and after each step by checking real project changes.
|
|
47
|
-
- Security violations pause the REPL with `continue`, `stop`, and `diff` options.
|
|
48
|
-
- `--debug` pauses before each step with `continue`, `inspect`, `edit`, `skip`, and `abort`.
|
|
49
|
-
- Debug also pauses after each step to inspect parsed outputs, written files, detected changes, and diffs before continuing.
|
|
50
|
-
- Debug inspect shows the full prompt that will be sent to the provider.
|
|
51
|
-
- Debug edit lets you override resolved step inputs for the current run only.
|
|
52
|
-
- Debug replay can rerun a step with adjusted inputs; project file changes from the previous attempt are restored first.
|
|
53
|
-
- Debug replay stores repeated step artifacts under `attempt-1`, `attempt-2`, etc.; steps without replay keep artifacts at the step root.
|
|
54
|
-
- Debug replay is capped per step and only restores detected project file changes, not external side effects.
|
|
55
|
-
- Edited inputs are marked in prompt preview with `debug-edited="true"` to make prompt priority easier to inspect.
|
|
56
|
-
- Debug decisions are recorded in `run-manifest.json` as lightweight `debugEvents`.
|
|
57
|
-
- Debug runs are stored with a `DEBUG-` prefix in `.singleton/runs/`.
|
|
58
|
-
- Raw provider output can be inspected during debug and is saved as `raw-output.md` when structured output parsing fails or debug detects output warnings.
|
|
59
|
-
- Run manifests are written even when a pipeline fails, so partial runs remain inspectable.
|
|
60
|
-
- `/commit-last` previews files, applies security exclusions, and asks for confirmation.
|
|
61
|
-
|
|
62
19
|
## Install
|
|
63
20
|
|
|
64
|
-
|
|
21
|
+
Requirements: Node 20+ and at least one authenticated provider CLI in your `$PATH`: `claude`, `codex`, `copilot`, or `opencode`.
|
|
65
22
|
|
|
66
23
|
```bash
|
|
67
24
|
npm install -g singleton-pipeline@beta
|
|
68
25
|
singleton --version
|
|
69
26
|
```
|
|
70
27
|
|
|
71
|
-
Or run
|
|
28
|
+
Or run without a global install:
|
|
72
29
|
|
|
73
30
|
```bash
|
|
74
31
|
npx singleton-pipeline@beta --help
|
|
75
32
|
```
|
|
76
33
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Requirements: Node 20+.
|
|
80
|
-
|
|
81
|
-
### From source (development)
|
|
34
|
+
For development from source:
|
|
82
35
|
|
|
83
36
|
```bash
|
|
84
37
|
git clone https://github.com/RomainLENTZ/singleton_pipeline.git
|
|
85
38
|
cd singleton_pipeline
|
|
86
39
|
npm install
|
|
87
|
-
npm link
|
|
40
|
+
npm link
|
|
88
41
|
```
|
|
89
42
|
|
|
90
43
|
## Quickstart
|
|
91
44
|
|
|
92
|
-
|
|
45
|
+
Validate the bundled mixed-provider example without calling an LLM:
|
|
93
46
|
|
|
94
47
|
```bash
|
|
95
|
-
singleton run --pipeline examples/mixed-code-review/.singleton/pipelines/text-spec-to-code-review-mixed.json
|
|
48
|
+
singleton run --pipeline examples/mixed-code-review/.singleton/pipelines/text-spec-to-code-review-mixed.json --dry-run
|
|
96
49
|
```
|
|
97
50
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
Use `--debug` to pause before each step, inspect the prompt, and adjust inputs for the current run:
|
|
51
|
+
To run the same template for real, copy or adapt `examples/mixed-code-review/.singleton` into the target project, then run the pipeline from that project. Writer steps are restricted to `src/` by default.
|
|
101
52
|
|
|
102
53
|
```bash
|
|
103
|
-
singleton run --pipeline
|
|
54
|
+
singleton run --pipeline .singleton/pipelines/text-spec-to-code-review-mixed.json
|
|
104
55
|
```
|
|
105
56
|
|
|
106
|
-
|
|
57
|
+
The pipeline prompts for:
|
|
107
58
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
# → http://localhost:5173
|
|
112
|
-
```
|
|
59
|
+
- a text spec
|
|
60
|
+
- a target file path
|
|
61
|
+
- the same target file as readable context
|
|
113
62
|
|
|
114
|
-
|
|
63
|
+
Use debug mode to inspect the prompt, edit runtime inputs, review outputs, or replay one step:
|
|
115
64
|
|
|
116
65
|
```bash
|
|
117
|
-
singleton
|
|
66
|
+
singleton run --pipeline .singleton/pipelines/text-spec-to-code-review-mixed.json --debug
|
|
118
67
|
```
|
|
119
68
|
|
|
120
|
-
##
|
|
69
|
+
## Current Beta Tips
|
|
121
70
|
|
|
122
|
-
|
|
71
|
+
For now, the most reliable way to author pipelines is to edit the `.singleton` files directly with a local coding agent or LLM running in your terminal. Ask it to create or update:
|
|
123
72
|
|
|
124
|
-
-
|
|
125
|
-
-
|
|
73
|
+
- `.singleton/agents/*.md`
|
|
74
|
+
- `.singleton/pipelines/*.json`
|
|
75
|
+
- `.singleton/security.json`
|
|
126
76
|
|
|
127
|
-
|
|
77
|
+
The web builder is available and useful for visualizing the model, but it is still early and planned for redesign. For production-ish workflows, prefer terminal-authored Markdown agents and JSON pipelines, then validate with `--dry-run`.
|
|
128
78
|
|
|
129
|
-
|
|
130
|
-
| ---------------------- | --------- | --------------------------------------------- |
|
|
131
|
-
| `$INPUT:<id>` | in | a value supplied at run time |
|
|
132
|
-
| `$FILE:<path>` | in / out | read or write a single file |
|
|
133
|
-
| `$PIPE:<agent>.<out>` | in | grab the output of a previous step |
|
|
134
|
-
| `$FILES:<dir>` | out | let an agent emit several files at once |
|
|
79
|
+
Singleton currently works best in a Unix-like terminal environment. The project is primarily developed and tested from macOS Terminal/iTerm-style shells; Linux should be the closest runtime profile. Native Windows terminal support is not the main target today, so use WSL if you need to run Singleton on Windows.
|
|
135
80
|
|
|
136
|
-
|
|
81
|
+
## Everyday CLI
|
|
137
82
|
|
|
138
|
-
|
|
83
|
+
Start the Singleton shell:
|
|
139
84
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
85
|
+
```bash
|
|
86
|
+
singleton
|
|
87
|
+
```
|
|
143
88
|
|
|
144
|
-
|
|
89
|
+
Common REPL commands:
|
|
145
90
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
91
|
+
```txt
|
|
92
|
+
/scan
|
|
93
|
+
/new
|
|
94
|
+
/run <pipeline> [--dry] [--verbose] [--debug]
|
|
95
|
+
/serve
|
|
96
|
+
/commit-last
|
|
97
|
+
/ls
|
|
98
|
+
/help
|
|
99
|
+
```
|
|
149
100
|
|
|
150
|
-
|
|
151
|
-
| --- | --- | --- | --- | --- |
|
|
152
|
-
| `read-only` | native (`--disallowedTools Write,Edit,Bash,NotebookEdit`) | native (`--sandbox read-only`) | native (`--deny-tool=write --deny-tool=shell`) | native (`permission.edit=deny`) |
|
|
153
|
-
| `restricted-write` (per `allowed_paths`) | ⚠ no per-path filter → Layer 3 enforces | ⚠ no per-path filter → Layer 3 enforces | ✅ native (`--allow-tool=write(path)`) | ✅ native (`permission.edit` per pattern) |
|
|
154
|
-
| `workspace-write` | native (`--permission-mode acceptEdits`) | native (`--sandbox workspace-write`) | native (`--allow-tool=write`) | native (`permission.edit=allow`) |
|
|
155
|
-
| `dangerous` | bypass (`--permission-mode bypassPermissions`) | bypass (`--sandbox danger-full-access`) | bypass (`--allow-all-tools`) | bypass (`--dangerously-skip-permissions`) |
|
|
101
|
+
Create a new agent directly:
|
|
156
102
|
|
|
157
|
-
|
|
103
|
+
```bash
|
|
104
|
+
singleton new --root /path/to/project
|
|
105
|
+
```
|
|
158
106
|
|
|
159
|
-
|
|
107
|
+
Scan agents and refresh `.singleton/agents.json`:
|
|
160
108
|
|
|
161
|
-
|
|
109
|
+
```bash
|
|
110
|
+
singleton scan /path/to/project
|
|
111
|
+
```
|
|
162
112
|
|
|
163
|
-
|
|
113
|
+
## Builder
|
|
164
114
|
|
|
165
|
-
|
|
166
|
-
| ------- | --------- | ------- |
|
|
167
|
-
| `examples/claude-code-review` | Claude | Text spec -> scout -> code writer -> reviewer |
|
|
168
|
-
| `examples/codex-code-review` | Codex | Same code workflow, using Codex only |
|
|
169
|
-
| `examples/mixed-code-review` | Claude + Codex | Claude scouts/reviews, Codex edits code |
|
|
170
|
-
| `examples/frontend-audit` | Claude | Read-only frontend audit pipeline |
|
|
171
|
-
| `examples/opencode-review` | OpenCode | Experimental read-only review pipeline |
|
|
115
|
+
If you installed the package, `singleton serve` starts the project API and serves the built web UI:
|
|
172
116
|
|
|
173
|
-
|
|
117
|
+
```bash
|
|
118
|
+
singleton serve --root /path/to/project
|
|
119
|
+
# http://localhost:4317
|
|
120
|
+
```
|
|
174
121
|
|
|
175
|
-
|
|
122
|
+
When developing the web app from source, run the API and Vite separately:
|
|
176
123
|
|
|
177
124
|
```bash
|
|
178
|
-
singleton
|
|
125
|
+
singleton serve --root /path/to/project
|
|
126
|
+
cd packages/web
|
|
127
|
+
npm run dev
|
|
128
|
+
# http://localhost:5173
|
|
179
129
|
```
|
|
180
130
|
|
|
181
|
-
|
|
131
|
+
The Vite dev server proxies `/api` to `http://localhost:4317`.
|
|
182
132
|
|
|
183
|
-
|
|
133
|
+
## How It Works
|
|
134
|
+
|
|
135
|
+
A Singleton project usually contains:
|
|
184
136
|
|
|
185
137
|
```txt
|
|
186
138
|
my-project/
|
|
187
139
|
.singleton/
|
|
188
|
-
agents/ #
|
|
189
|
-
pipelines/ # saved
|
|
190
|
-
runs/ #
|
|
191
|
-
|
|
192
|
-
|
|
140
|
+
agents/ # Singleton-native Markdown agents
|
|
141
|
+
pipelines/ # saved pipeline JSON files
|
|
142
|
+
runs/ # run artifacts and manifests
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
An agent is a Markdown file with a `## Config` section and a prompt:
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
# Code Writer
|
|
149
|
+
|
|
150
|
+
## Config
|
|
151
|
+
|
|
152
|
+
- **id**: code-writer
|
|
153
|
+
- **description**: Applies a bounded implementation.
|
|
154
|
+
- **inputs**: spec, target_path
|
|
155
|
+
- **outputs**: execution_report
|
|
156
|
+
- **provider**: codex
|
|
157
|
+
- **model**: gpt-5.4
|
|
158
|
+
- **security_profile**: restricted-write
|
|
159
|
+
- **allowed_paths**: src/
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Prompt
|
|
164
|
+
|
|
165
|
+
Apply the requested change to `<target_path>` and return a concise report.
|
|
193
166
|
```
|
|
194
167
|
|
|
195
|
-
|
|
168
|
+
A pipeline is a JSON file with ordered `steps[]`. The builder may also store `nodes[]` and graph metadata for visual editing, but runtime execution follows `steps[]` in the saved order. `$PIPE` references must point to outputs from earlier steps; preflight fails on future or missing references.
|
|
169
|
+
|
|
170
|
+
Step inputs and outputs use four reference types:
|
|
171
|
+
|
|
172
|
+
| Reference | Direction | Purpose |
|
|
173
|
+
| --- | --- | --- |
|
|
174
|
+
| `$INPUT:<id>` | input | runtime text or file input |
|
|
175
|
+
| `$FILE:<path>` | input/output | read or write one file |
|
|
176
|
+
| `$PIPE:<agent>.<out>` | input | consume an earlier step output |
|
|
177
|
+
| `$FILES:<dir>` | output | write multiple files from a JSON manifest |
|
|
178
|
+
|
|
179
|
+
Each real run writes `.singleton/runs/<id>/run-manifest.json`, even when the pipeline fails after starting.
|
|
180
|
+
|
|
181
|
+
## Security
|
|
182
|
+
|
|
183
|
+
Singleton resolves a `security_profile` for every step:
|
|
184
|
+
|
|
185
|
+
- `read-only`
|
|
186
|
+
- `restricted-write`
|
|
187
|
+
- `workspace-write`
|
|
188
|
+
- `dangerous`
|
|
189
|
+
|
|
190
|
+
Enforcement happens in three layers:
|
|
191
|
+
|
|
192
|
+
1. prompt policy injected into the step message
|
|
193
|
+
2. provider-native CLI permissions where available
|
|
194
|
+
3. deterministic post-run snapshot diff against the project filesystem
|
|
195
|
+
|
|
196
|
+
The third layer is the main guarantee. It catches direct file edits made by provider CLIs even when they did not go through a declared `$FILE` or `$FILES` output.
|
|
197
|
+
|
|
198
|
+
Recommended defaults:
|
|
199
|
+
|
|
200
|
+
- scouts, auditors, planners, reviewers: `read-only`
|
|
201
|
+
- code writers: `restricted-write` with the smallest useful `allowed_paths`
|
|
202
|
+
- broad refactors: `restricted-write` with a project directory such as `src`
|
|
203
|
+
- avoid `dangerous` outside local experiments
|
|
196
204
|
|
|
197
|
-
|
|
205
|
+
## Providers
|
|
206
|
+
|
|
207
|
+
Singleton currently supports:
|
|
208
|
+
|
|
209
|
+
| Provider | CLI | Notes |
|
|
210
|
+
| --- | --- | --- |
|
|
211
|
+
| Claude | `claude` | supports `model` and Claude `permission_mode` |
|
|
212
|
+
| Codex | `codex` | receives `AGENTS.md` / `AGENTS.override.md` as project instructions |
|
|
213
|
+
| Copilot | `copilot` | supports optional `runner_agent` mapped to `--agent` |
|
|
214
|
+
| OpenCode | `opencode` | experimental provider with native permission config injection |
|
|
215
|
+
|
|
216
|
+
Singleton has no hosted backend. Provider CLIs still use their own networked services according to their normal behavior.
|
|
217
|
+
|
|
218
|
+
## Agent Sources
|
|
219
|
+
|
|
220
|
+
Singleton scans Markdown agents from:
|
|
221
|
+
|
|
222
|
+
- `.singleton/agents/*.md`
|
|
223
|
+
- `.claude/agents/*.md`
|
|
224
|
+
- `.github/agents/*.md`
|
|
225
|
+
- `.opencode/agents/*.md`
|
|
226
|
+
|
|
227
|
+
When duplicate agent ids exist, `.singleton/agents` wins over compatibility sources.
|
|
228
|
+
|
|
229
|
+
Copilot repo-level profiles are usually `.github/agents/*.agent.md` and are also used by Copilot when a Singleton agent sets `runner_agent`. If no `runner_agent` is set, Copilot uses its default agent.
|
|
230
|
+
|
|
231
|
+
`AGENTS.md` and `AGENTS.override.md` are not Singleton agents; they are forwarded to Codex as project context.
|
|
232
|
+
|
|
233
|
+
## Examples
|
|
234
|
+
|
|
235
|
+
| Example | Providers | Purpose |
|
|
236
|
+
| --- | --- | --- |
|
|
237
|
+
| `examples/claude-code-review` | Claude | Text spec -> scout -> code writer -> reviewer |
|
|
238
|
+
| `examples/codex-code-review` | Codex | Same workflow with Codex only |
|
|
239
|
+
| `examples/mixed-code-review` | Claude + Codex | Claude scouts/reviews, Codex edits code |
|
|
240
|
+
| `examples/frontend-audit` | Claude | Read-only frontend audit |
|
|
241
|
+
| `examples/opencode-review` | OpenCode | Experimental read-only review |
|
|
198
242
|
|
|
199
|
-
|
|
243
|
+
The code-review examples are templates. They do not ship a toy source file; use `--dry-run` as-is, then copy or adapt their `.singleton` folders into a real project before running writer steps against real files.
|
|
200
244
|
|
|
201
|
-
##
|
|
245
|
+
## Documentation
|
|
202
246
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|  |  |
|
|
206
|
-
| **Help** | **Run summary** |
|
|
207
|
-
|  |  |
|
|
247
|
+
- Full behavior reference: [docs/reference.md](docs/reference.md)
|
|
248
|
+
- Release notes: [CHANGELOG.md](CHANGELOG.md)
|
|
208
249
|
|
|
209
|
-
## Repo
|
|
250
|
+
## Repo Layout
|
|
210
251
|
|
|
211
252
|
```txt
|
|
212
253
|
packages/cli CLI, REPL, executor, runners
|