@sublang/slc 0.3.0 → 0.5.0
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/README.md +102 -84
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +13 -5
- package/dist/app.js.map +1 -1
- package/dist/build-history.d.ts +74 -0
- package/dist/build-history.d.ts.map +1 -0
- package/dist/build-history.js +309 -0
- package/dist/build-history.js.map +1 -0
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/compiled-executor.d.ts +1 -1
- package/dist/compiled-executor.d.ts.map +1 -1
- package/dist/compiled-executor.js +10 -3
- package/dist/compiled-executor.js.map +1 -1
- package/dist/config-file.d.ts +4 -0
- package/dist/config-file.d.ts.map +1 -1
- package/dist/config-file.js +19 -8
- package/dist/config-file.js.map +1 -1
- package/dist/config.d.ts +6 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +65 -12
- package/dist/config.js.map +1 -1
- package/dist/errors.d.ts +14 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +28 -0
- package/dist/errors.js.map +1 -0
- package/dist/execution.d.ts +42 -0
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +224 -29
- package/dist/execution.js.map +1 -1
- package/dist/hash.d.ts +22 -0
- package/dist/hash.d.ts.map +1 -1
- package/dist/hash.js +47 -0
- package/dist/hash.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interpreter.d.ts +1 -1
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +9 -0
- package/dist/interpreter.js.map +1 -1
- package/dist/invocation.d.ts +5 -1
- package/dist/invocation.d.ts.map +1 -1
- package/dist/invocation.js +14 -3
- package/dist/invocation.js.map +1 -1
- package/dist/line-diff.d.ts +7 -0
- package/dist/line-diff.d.ts.map +1 -0
- package/dist/line-diff.js +66 -0
- package/dist/line-diff.js.map +1 -0
- package/dist/phase.d.ts +2 -0
- package/dist/phase.d.ts.map +1 -1
- package/dist/phase.js +19 -3
- package/dist/phase.js.map +1 -1
- package/dist/pin-closure.d.ts +2 -2
- package/dist/pin-closure.d.ts.map +1 -1
- package/dist/pin-closure.js +4 -3
- package/dist/pin-closure.js.map +1 -1
- package/dist/pin-currency.d.ts +6 -2
- package/dist/pin-currency.d.ts.map +1 -1
- package/dist/pin-currency.js +24 -43
- package/dist/pin-currency.js.map +1 -1
- package/dist/pin-generate.d.ts.map +1 -1
- package/dist/pin-generate.js +1 -3
- package/dist/pin-generate.js.map +1 -1
- package/dist/pin-paths.d.ts.map +1 -1
- package/dist/pin-paths.js +2 -13
- package/dist/pin-paths.js.map +1 -1
- package/dist/pins.d.ts.map +1 -1
- package/dist/pins.js +5 -15
- package/dist/pins.js.map +1 -1
- package/dist/playbook-ports.d.ts +9 -0
- package/dist/playbook-ports.d.ts.map +1 -1
- package/dist/playbook-ports.js +10 -5
- package/dist/playbook-ports.js.map +1 -1
- package/dist/reviewing-agent.d.ts +18 -0
- package/dist/reviewing-agent.d.ts.map +1 -0
- package/dist/reviewing-agent.js +295 -0
- package/dist/reviewing-agent.js.map +1 -0
- package/dist/runner.d.ts +2 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +628 -88
- package/dist/runner.js.map +1 -1
- package/dist/runtime-package.d.ts.map +1 -1
- package/dist/runtime-package.js +3 -11
- package/dist/runtime-package.js.map +1 -1
- package/dist/slc.config.template.yaml +6 -2
- package/dist/verify-coverage.d.ts.map +1 -1
- package/dist/verify-coverage.js +2 -0
- package/dist/verify-coverage.js.map +1 -1
- package/dist/verify-support.d.ts +7 -0
- package/dist/verify-support.d.ts.map +1 -1
- package/dist/verify-support.js +13 -6
- package/dist/verify-support.js.map +1 -1
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +2 -0
- package/dist/verify.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,17 +19,18 @@ through it. Why compile prose instead of prompting with it:
|
|
|
19
19
|
stop — the control flow becomes an inspectable
|
|
20
20
|
[XState](https://xstate.js.org) machine, not prompt improvisation.
|
|
21
21
|
LLM judgment is confined to the work *inside* each state.
|
|
22
|
-
- **Auditable at every stage.**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
binding its output to the source spec.
|
|
22
|
+
- **Auditable at every stage.** Every intermediate is a file you can
|
|
23
|
+
read and edit: the normalized text, one testable "shall" item per
|
|
24
|
+
behavior, the state machine itself. The compiler also emits tests
|
|
25
|
+
binding its output back to the spec.
|
|
27
26
|
- **Cheaper and safer by optimization.** Steps that need no judgment are
|
|
28
27
|
rewritten at compile time into plain shell commands — no LLM call, no
|
|
29
|
-
hallucination
|
|
28
|
+
hallucination.
|
|
30
29
|
- **Your agents, per role.** Compilation and execution run through the
|
|
31
30
|
agent CLIs you already use — Claude Code, Codex, Gemini, OpenCode —
|
|
32
|
-
selectable per role
|
|
31
|
+
selectable per role, with an optional
|
|
32
|
+
[second agent reviewing](#reviewed-compilation-two-agents) every
|
|
33
|
+
compile step.
|
|
33
34
|
|
|
34
35
|
The flagship pipeline is `playbook` (the name of both the pipeline and
|
|
35
36
|
the sibling [playbook](https://github.com/sublang-ai/playbook) project
|
|
@@ -41,9 +42,9 @@ a linked module the `playbook` CLI runs.
|
|
|
41
42
|
The [demo](demo/README.md) compiles a one-paragraph description into a
|
|
42
43
|
two-agent code-review loop, then lets it loose on a buggy C file: the
|
|
43
44
|
coder and reviewer commit, review, and debate inside a real Git
|
|
44
|
-
repository until the review comes back clean. Precompiled
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
repository until the review comes back clean. Precompiled artifacts are
|
|
46
|
+
included, so you can watch a run — or read every compile stage —
|
|
47
|
+
without waiting on a compile.
|
|
47
48
|
|
|
48
49
|
## Install
|
|
49
50
|
|
|
@@ -53,60 +54,42 @@ npm install -g @anthropic-ai/claude-agent-sdk @openai/codex-sdk
|
|
|
53
54
|
slc --version
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
The second line supplies the agent SDKs for the default Claude and Codex
|
|
57
|
-
lineup. Playbook 4 installs none itself — which versions work is
|
|
58
|
-
`@sublang/cligent`'s to enforce at load — so name the SDKs your own
|
|
59
|
-
configuration needs. If one is missing, the compile stops before any
|
|
60
|
-
agent call and names the package to install; if one is too old, it
|
|
61
|
-
names the installed and required versions along with the exact version
|
|
62
|
-
to install.
|
|
63
|
-
|
|
64
|
-
Compiled artifacts import the Playbook engine from their own directory;
|
|
65
|
-
when that import does not resolve, `playbook run` (3.1+) links its own
|
|
66
|
-
engine beside the artifact and says so (`--no-provision` opts out).
|
|
67
|
-
Working inside an npm project instead? Install the same set there — the
|
|
68
|
-
compiler, the engine, and the SDKs your lineup uses — and prefix the
|
|
69
|
-
commands with `npx`. A project's own install is always authoritative,
|
|
70
|
-
and a globally installed SDK is invisible to a project's nested
|
|
71
|
-
`@sublang/cligent`, so the SDKs belong in the same tree
|
|
72
|
-
([RELEASE-11](specs/dev/release.md#release-11) has the full rules).
|
|
73
|
-
|
|
74
57
|
Requirements:
|
|
75
58
|
|
|
76
|
-
- A POSIX platform — macOS or Linux; on Windows, use WSL (or Git
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- Node.js >= 23.6 (compiled phase artifacts are imported as native
|
|
80
|
-
TypeScript at runtime).
|
|
59
|
+
- A POSIX platform — macOS or Linux; on Windows, use WSL (or Git Bash).
|
|
60
|
+
Compiled script steps execute through `sh`.
|
|
61
|
+
- Node.js >= 23.6 (compiled artifacts are imported as native TypeScript).
|
|
81
62
|
- One supported coding-agent CLI, installed and authenticated:
|
|
82
63
|
[Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview),
|
|
83
64
|
[Codex CLI](https://github.com/openai/codex),
|
|
84
65
|
[Gemini CLI](https://github.com/google-gemini/gemini-cli), or
|
|
85
66
|
[OpenCode](https://opencode.ai).
|
|
86
67
|
|
|
68
|
+
The second install line supplies the agent SDKs for the default Claude
|
|
69
|
+
and Codex lineup; name the SDKs your own lineup needs instead. A missing
|
|
70
|
+
or too-old SDK stops the compile before any agent call and names the
|
|
71
|
+
exact package and version to install.
|
|
72
|
+
|
|
73
|
+
Compiled artifacts import the Playbook engine from their own directory;
|
|
74
|
+
when that import does not resolve, `playbook run` (3.1+) links its own
|
|
75
|
+
engine beside the artifact and says so (`--no-provision` opts out).
|
|
76
|
+
Working inside an npm project? Install the same set there and prefix the
|
|
77
|
+
commands with `npx`: a project-local install is authoritative wherever it
|
|
78
|
+
resolves, a project manifest declaring `@sublang/playbook` must install
|
|
79
|
+
it itself, and a global SDK is invisible to a project's nested
|
|
80
|
+
`@sublang/cligent`
|
|
81
|
+
([RELEASE-11](specs/dev/release.md#release-11) has the full rules).
|
|
82
|
+
|
|
87
83
|
## Quick start
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
Write a prose workflow as a `.md` or `.txt` file —
|
|
86
|
+
[`demo/workflow.txt`](demo/workflow.txt) is a complete one-paragraph
|
|
87
|
+
example — and compile it from any directory:
|
|
92
88
|
|
|
93
89
|
```bash
|
|
94
90
|
slc playbook my-workflow.md
|
|
95
91
|
```
|
|
96
92
|
|
|
97
|
-
`slc` finds the `playbook` pipeline inside its own `@sublang/playbook`
|
|
98
|
-
dependency, so it compiles in any directory — no clone, no project
|
|
99
|
-
setup. Compilation drives your configured coding agent — the first run
|
|
100
|
-
seeds `~/.config/slc/config.yaml` with `agent: claude-code`; set
|
|
101
|
-
`SLC_AGENT` (or edit that file) to use another agent CLI. Expect it to
|
|
102
|
-
take a while: duration is agent- and workload-dependent, and measured
|
|
103
|
-
compiles of a five-line workflow have run from tens of minutes to more
|
|
104
|
-
than two hours, with the first intermediate typically landing within
|
|
105
|
-
about five minutes. Plain-text input (`.txt`) works too; it is
|
|
106
|
-
normalized first. The pipeline's optimization pass, which rewrites
|
|
107
|
-
judgment-free steps into plain script, runs by default
|
|
108
|
-
(`--no-optimize` skips it).
|
|
109
|
-
|
|
110
93
|
Artifacts land in your working directory: `my-workflow.playbook/` holds
|
|
111
94
|
the intermediates — `my-workflow.gears.md`, the XState machine
|
|
112
95
|
`my-workflow.fsm.ts`, the linked runtime module, and its verification
|
|
@@ -116,56 +99,91 @@ tests — and `my-workflow.ts` is the runnable entry. Run it:
|
|
|
116
99
|
playbook run ./my-workflow.ts "<your task>"
|
|
117
100
|
```
|
|
118
101
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
102
|
+
Compilation drives your configured coding agent, so **expect it to take
|
|
103
|
+
a while**: measured compiles of a five-line workflow have run from tens
|
|
104
|
+
of minutes to more than two hours, with the first intermediate typically
|
|
105
|
+
landing within about five minutes. Meanwhile `slc` reports each phase,
|
|
106
|
+
each artifact with its elapsed time, and a heartbeat at least every 30
|
|
107
|
+
seconds on stderr; an agent call that goes silent for `stallTimeout`
|
|
108
|
+
seconds fails that phase instead of hanging. Success prints the artifact
|
|
109
|
+
paths and exits 0; a failure prints diagnostics naming the failing phase
|
|
110
|
+
and exits non-zero.
|
|
111
|
+
|
|
112
|
+
Intermediates are first-class: edit one, re-run a single phase
|
|
113
|
+
(`slc playbook.gears2fsm …`), and it lands in the same place.
|
|
114
|
+
`slc --help` shows all invocation forms and flags, including
|
|
115
|
+
`--no-optimize` to skip the optimization pass.
|
|
116
|
+
|
|
117
|
+
### Incremental recompiles
|
|
118
|
+
|
|
119
|
+
A successful full compile is snapshotted under `<artifact-dir>/.slc/`,
|
|
120
|
+
so a re-run only redoes what changed. Per phase, `slc` picks:
|
|
121
|
+
|
|
122
|
+
- **Reuse** — inputs are byte-identical: no agent call, and the artifact
|
|
123
|
+
on disk is left exactly as it is, manual refinements included.
|
|
124
|
+
- **Update** — inputs changed: the phase runs ordinarily and also
|
|
125
|
+
receives its prior input and a diff, as a hint to update the artifact
|
|
126
|
+
rather than rewrite it from scratch.
|
|
127
|
+
- **Ordinary** — no usable record, a changed link phase, or `--rebuild`.
|
|
128
|
+
|
|
129
|
+
A run that reuses everything prints `up to date` instead of paths.
|
|
130
|
+
History is success-only, so an interrupted or failed run simply leaves
|
|
131
|
+
the next one to compile ordinarily. `.slc/` holds verbatim copies of
|
|
132
|
+
your source and outputs — treat it as no less private, gitignore it if
|
|
133
|
+
you commit the bundle, and delete it freely. Excluded invocation forms
|
|
134
|
+
and the full rules are in the
|
|
135
|
+
[incremental spec](specs/user/incremental-compilation.md).
|
|
133
136
|
|
|
134
137
|
## Configuration
|
|
135
138
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
and `pipelinePath` to the working directory.
|
|
139
|
+
The first run seeds `~/.config/slc/config.yaml` with
|
|
140
|
+
`agent: claude-code`, so a fresh machine needs no setup. A
|
|
141
|
+
`slc.config.yaml` in the working directory wins over the user config,
|
|
142
|
+
and `SLC_AGENT`, `SLC_MODEL`, and the other `SLC_*` variables override
|
|
143
|
+
either, per key.
|
|
142
144
|
|
|
143
145
|
```yaml
|
|
144
146
|
# slc.config.yaml
|
|
145
147
|
agent: claude-code # claude-code | codex | gemini | opencode
|
|
146
148
|
model: claude-opus-4-8 # optional; omit to use the agent CLI's default
|
|
149
|
+
effort: high # optional adapter-scoped reasoning effort
|
|
150
|
+
reviewerAgent: codex # optional; enables reviewed compilation
|
|
151
|
+
reviewerModel: gpt-5.3-codex # optional reviewer model
|
|
152
|
+
reviewerEffort: xhigh # optional reviewer reasoning effort
|
|
147
153
|
stallTimeout: 600 # seconds of agent silence before a stalled call fails
|
|
148
154
|
pipelinePath: # search roots for <pipeline> references; defaults to the cwd
|
|
149
155
|
- ./pipelines
|
|
150
156
|
```
|
|
151
157
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
Discovery order, `--config`, and validation rules live in the
|
|
159
|
+
[CLI spec](specs/user/cli.md); `slc --help` prints the summary.
|
|
160
|
+
|
|
161
|
+
### Reviewed compilation (two agents)
|
|
162
|
+
|
|
163
|
+
Set `reviewerAgent` to compile with two independent agents. Your `agent`
|
|
164
|
+
selection is the Coder that writes each artifact; the Reviewer then
|
|
165
|
+
inspects that work read-only and reports only material correctness or
|
|
166
|
+
spec defects, and the Coder answers every finding with evidence and a
|
|
167
|
+
minimal fix. Up to three review rounds — if the third still reports
|
|
168
|
+
findings, the phase fails closed and names them rather than shipping a
|
|
169
|
+
questionable artifact.
|
|
170
|
+
|
|
171
|
+
It costs at least one extra agent call per transformation that runs.
|
|
172
|
+
Reuse performs no transformation and so makes no calls; Update,
|
|
173
|
+
Ordinary, and `--rebuild` use the loop automatically
|
|
174
|
+
([DR-022](specs/decisions/022-two-agent-reviewed-compilation.md)).
|
|
157
175
|
|
|
158
176
|
## How pipelines work
|
|
159
177
|
|
|
160
178
|
A pipeline is a directory of phase definitions named
|
|
161
179
|
`<source-format>2<target-format>.md`, each declaring its formats in a
|
|
162
|
-
`## Formats` table, plus an optional `link.md`
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
180
|
+
`## Formats` table, plus an optional `link.md` for the terminal link
|
|
181
|
+
phase. `slc` infers phase order by chaining formats — no manifest — and
|
|
182
|
+
refuses incomplete, branching, or cyclic chains. Adding a phase means
|
|
183
|
+
writing a definition, never changing the compiler: `slc` itself performs
|
|
184
|
+
only the generic mechanics of chaining, validation, and artifact
|
|
185
|
+
placement. The bundled `playbook` pipeline chains `text2gears` and
|
|
186
|
+
`gears2fsm`, with `link` emitting the runnable runtime.
|
|
169
187
|
|
|
170
188
|
Every phase runs through a coding agent, one of two ways:
|
|
171
189
|
|
|
@@ -173,9 +191,9 @@ Every phase runs through a coding agent, one of two ways:
|
|
|
173
191
|
performs it. This is how an npm-installed `slc` runs the `playbook`
|
|
174
192
|
pipeline, using the definitions shipped inside `@sublang/playbook`.
|
|
175
193
|
- **Compiled** — the phase's own compiled playbook artifact drives the
|
|
176
|
-
agent through audited state-machine steps. This repository
|
|
177
|
-
|
|
178
|
-
|
|
194
|
+
agent through audited state-machine steps. This repository runs its
|
|
195
|
+
bundled phases this way: `slc` is self-hosting, its phase definitions
|
|
196
|
+
compiled, reviewed, and sha256-pinned under
|
|
179
197
|
[`pipelines/playbook/`](pipelines/playbook), failing closed on drift
|
|
180
198
|
([self-hosting spec](specs/user/self-hosting.md)).
|
|
181
199
|
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EAExB,KAAK,cAAc,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAM1E,OAAO,EAAU,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAUnD,wBAAwB;AACxB,eAAO,MAAM,IAAI,QAAQ,CAAC;AAE1B,sCAAsC;AACtC,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,4EAA4E;AAC5E,MAAM,MAAM,WAAW,GAAG,CAAC,EAAE,EAAE;IAC7B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,WAAW,CAAC;IACpB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,CAAC,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BAAgB,CAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,IAAI,EAAE,UAAU,GACf,SAAS,CAgBX;AAyBD,mFAAmF;AACnF,wBAAgB,SAAS,IAAI,MAAM,CA2ClC;AA6BD;;;;GAIG;AACH,wBAAsB,GAAG,CACvB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CA+DjB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IACnD,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CAC9D,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAY/C"}
|
package/dist/app.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* and signal wiring. See specs/dev/cli.md and specs/user/cli.md.
|
|
15
15
|
*/
|
|
16
16
|
import { createRequire } from 'node:module';
|
|
17
|
+
import { messageOf } from './errors.js';
|
|
17
18
|
import { createConfiguredCompiledFactory, createConfiguredExecutor, resolveAgentSelection, } from './config.js';
|
|
18
19
|
import { loadConfigFile, MAX_STALL_TIMEOUT_SECONDS, } from './config-file.js';
|
|
19
20
|
import { createProgressReporter } from './progress.js';
|
|
@@ -99,6 +100,9 @@ export function resolveRunConfig(env, file) {
|
|
|
99
100
|
SLC_AGENT: nonBlank(env.SLC_AGENT) ?? file.agent,
|
|
100
101
|
SLC_MODEL: nonBlank(env.SLC_MODEL) ?? file.model,
|
|
101
102
|
SLC_EFFORT: nonBlank(env.SLC_EFFORT) ?? file.effort,
|
|
103
|
+
SLC_REVIEWER_AGENT: nonBlank(env.SLC_REVIEWER_AGENT) ?? file.reviewerAgent,
|
|
104
|
+
SLC_REVIEWER_MODEL: nonBlank(env.SLC_REVIEWER_MODEL) ?? file.reviewerModel,
|
|
105
|
+
SLC_REVIEWER_EFFORT: nonBlank(env.SLC_REVIEWER_EFFORT) ?? file.reviewerEffort,
|
|
102
106
|
});
|
|
103
107
|
const pipelinePath = nonBlank(env.SLC_PIPELINE_PATH) ?? file.pipelinePath;
|
|
104
108
|
const stallSeconds = parseStallTimeout(nonBlank(env.SLC_STALL_TIMEOUT)) ??
|
|
@@ -144,6 +148,7 @@ export function usageText() {
|
|
|
144
148
|
" --normalize rewrite raw input to the entry phase's source form first",
|
|
145
149
|
" -O, --optimize run the pipeline's pass phases (the default)",
|
|
146
150
|
' --no-optimize run the chain without pass phases',
|
|
151
|
+
' --rebuild recompile every phase, ignoring recorded build history',
|
|
147
152
|
' --config <path> load configuration from <path> (disables discovery)',
|
|
148
153
|
' -v, --version print version and exit',
|
|
149
154
|
' -h, --help print this help and exit',
|
|
@@ -153,11 +158,15 @@ export function usageText() {
|
|
|
153
158
|
' environment variable below:',
|
|
154
159
|
' ./slc.config.yaml',
|
|
155
160
|
' ${XDG_CONFIG_HOME:-~/.config}/slc/config.yaml',
|
|
156
|
-
' Keys: agent, model, effort,
|
|
161
|
+
' Keys: agent, model, effort, reviewerAgent, reviewerModel,',
|
|
162
|
+
' reviewerEffort, pipelinePath, stallTimeout.',
|
|
157
163
|
'',
|
|
158
164
|
' SLC_AGENT agent CLI: claude-code | codex | gemini | opencode',
|
|
159
165
|
' SLC_MODEL optional model for the agent CLI',
|
|
160
166
|
' SLC_EFFORT optional adapter-scoped reasoning effort (e.g. xhigh)',
|
|
167
|
+
' SLC_REVIEWER_AGENT optional independent reviewer; enables reviewed compilation',
|
|
168
|
+
' SLC_REVIEWER_MODEL optional model for the reviewer agent CLI',
|
|
169
|
+
' SLC_REVIEWER_EFFORT optional adapter-scoped reviewer reasoning effort',
|
|
161
170
|
' SLC_PIPELINE_PATH search roots for <pipeline> references (default: cwd)',
|
|
162
171
|
' SLC_STALL_TIMEOUT seconds of agent inactivity before a stalled call',
|
|
163
172
|
' fails the run (default: 600; 0 disables)',
|
|
@@ -242,7 +251,9 @@ export async function run(argv, options = {}) {
|
|
|
242
251
|
reporter.dispose();
|
|
243
252
|
}
|
|
244
253
|
if (result.ok) {
|
|
245
|
-
if (result.
|
|
254
|
+
if (result.outcome === 'up-to-date')
|
|
255
|
+
stdout('up to date\n');
|
|
256
|
+
else if (result.outputs.length > 0)
|
|
246
257
|
stdout(`${result.outputs.join('\n')}\n`);
|
|
247
258
|
// Surface any ambiguity the agent resolved without polluting the path output.
|
|
248
259
|
if (result.diagnostics.length > 0)
|
|
@@ -276,7 +287,4 @@ export function interruptSignal(emitter) {
|
|
|
276
287
|
function hasFlag(argv, ...flags) {
|
|
277
288
|
return argv.some((arg) => flags.includes(arg));
|
|
278
289
|
}
|
|
279
|
-
function messageOf(error) {
|
|
280
|
-
return error instanceof Error ? error.message : String(error);
|
|
281
|
-
}
|
|
282
290
|
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,0EAA0E;AAE1E;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EACxB,qBAAqB,GAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,yBAAyB,GAE1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAqB,MAAM,eAAe,CAAC;AAC1E,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAC;AAEnD,MAAM,QAAQ,GAAG,aAAa,CAA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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAG/B;IACC,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,WAAW,GAAG,GAAS,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACnD,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACrC,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,OAAO,EAAE,GAAG,EAAE;YACZ,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YAC9C,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACjD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,SAAS,OAAO,CAAC,IAAuB,EAAE,GAAG,KAAe;IAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type Hash } from './hash.js';
|
|
2
|
+
export declare const HISTORY_DIR = ".slc";
|
|
3
|
+
export declare const BUILD_MANIFEST_SCHEMA = "sublang.slc.build.v1";
|
|
4
|
+
export declare const SOURCE_COPY = "source";
|
|
5
|
+
export interface StepHistoryRecord {
|
|
6
|
+
kind: 'compile' | 'link';
|
|
7
|
+
name: string;
|
|
8
|
+
/** Artifact-directory-relative POSIX locator. */
|
|
9
|
+
target: string;
|
|
10
|
+
inputs: Hash[];
|
|
11
|
+
output: Hash;
|
|
12
|
+
}
|
|
13
|
+
export interface BuildManifest {
|
|
14
|
+
schema: typeof BUILD_MANIFEST_SCHEMA;
|
|
15
|
+
pipeline: string;
|
|
16
|
+
source: {
|
|
17
|
+
/** Artifact-directory-relative POSIX locator; may climb outward. */
|
|
18
|
+
path: string;
|
|
19
|
+
hash: Hash;
|
|
20
|
+
};
|
|
21
|
+
steps: StepHistoryRecord[];
|
|
22
|
+
}
|
|
23
|
+
export interface BuildHistory {
|
|
24
|
+
build: number;
|
|
25
|
+
dir: string;
|
|
26
|
+
manifest: BuildManifest;
|
|
27
|
+
}
|
|
28
|
+
export interface VerifiedInput {
|
|
29
|
+
path: string;
|
|
30
|
+
bytes: Buffer;
|
|
31
|
+
}
|
|
32
|
+
export interface StepToRecord {
|
|
33
|
+
kind: 'compile' | 'link';
|
|
34
|
+
name: string;
|
|
35
|
+
/** Absolute target path. */
|
|
36
|
+
target: string;
|
|
37
|
+
inputs: readonly Hash[];
|
|
38
|
+
/** Hash accepted by the runner before publication. */
|
|
39
|
+
output: Hash;
|
|
40
|
+
/** Bytes re-read by the runner immediately before publication. */
|
|
41
|
+
bytes: Uint8Array;
|
|
42
|
+
}
|
|
43
|
+
/** Encodes an absolute path relative to the artifact directory. */
|
|
44
|
+
export declare function encodeLocator(artDir: string, path: string): string;
|
|
45
|
+
/** Fixed path of a phase's recorded output copy. */
|
|
46
|
+
export declare function outputCopyPath(history: BuildHistory, index: number): string;
|
|
47
|
+
/**
|
|
48
|
+
* Loads and verifies the complete active build. Any malformed directory,
|
|
49
|
+
* marker, manifest, source copy, output copy, or hash makes history absent.
|
|
50
|
+
*/
|
|
51
|
+
export declare function loadBuildHistory(artDir: string): Promise<BuildHistory | null>;
|
|
52
|
+
/**
|
|
53
|
+
* Re-verifies the recorded chained input immediately before Update mode uses
|
|
54
|
+
* it. Step zero reads the source copy; later steps read the prior output copy.
|
|
55
|
+
*/
|
|
56
|
+
export declare function verifiedInput(history: BuildHistory, stepIndex: number, expected: Hash): Promise<VerifiedInput | null>;
|
|
57
|
+
/**
|
|
58
|
+
* Removes the active marker before the first executor may write. A valid
|
|
59
|
+
* active marker must be removable; malformed advisory state is never followed.
|
|
60
|
+
*/
|
|
61
|
+
export declare function invalidateBuildHistory(artDir: string, active: boolean): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Publishes one complete snapshot and commits its number last. Callers pass
|
|
64
|
+
* already-materialized source/output bytes, so publication never follows a
|
|
65
|
+
* live phase target.
|
|
66
|
+
*/
|
|
67
|
+
export declare function recordBuild(opts: {
|
|
68
|
+
artDir: string;
|
|
69
|
+
pipeline: string;
|
|
70
|
+
sourcePath: string;
|
|
71
|
+
sourceBytes: Uint8Array;
|
|
72
|
+
steps: readonly StepToRecord[];
|
|
73
|
+
}): Promise<void>;
|
|
74
|
+
//# sourceMappingURL=build-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-history.d.ts","sourceRoot":"","sources":["../src/build-history.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAC;AAEzD,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAC5D,eAAO,MAAM,WAAW,WAAW,CAAC;AAQpC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,EAAE,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,qBAAqB,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE;QACN,oEAAoE;QACpE,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,IAAI,CAAC;KACZ,CAAC;IACF,KAAK,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,G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