@jjanczur/tyran 0.1.1 → 0.1.2
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +79 -0
- package/package.json +1 -1
- package/scripts/doctor.mjs +49 -3
- package/scripts/scan-repo.mjs +129 -6
- package/scripts/yaml-lite.mjs +22 -1
- package/skills/run/SKILL.md +10 -0
- package/skills/setup/SKILL.md +22 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{
|
|
12
12
|
"name": "tyran",
|
|
13
13
|
"description": "A task conductor for Claude Code: multi-agent orchestration with an enforced evidence contract, repo-specific learning, and update-safe local evolution.",
|
|
14
|
-
"version": "0.1.
|
|
14
|
+
"version": "0.1.2",
|
|
15
15
|
"source": "./",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "Jacek Janczura",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tyran",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A task conductor for Claude Code: multi-agent orchestration with an enforced evidence contract, repo-specific learning, and update-safe local evolution.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jacek Janczura",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,84 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2 — 2026-07-29
|
|
4
|
+
|
|
5
|
+
From a field report on a real 0.1.1 install. Every item below is a failure
|
|
6
|
+
somebody hit, not one anybody predicted.
|
|
7
|
+
|
|
8
|
+
### The worktree with no boundary
|
|
9
|
+
|
|
10
|
+
**`git worktree add` carries tracked files only, and the policy gate is
|
|
11
|
+
deliberately silent in a repo with no `.tyran/`.** Put those together and an
|
|
12
|
+
uncommitted `.tyran/` means every worktree the conductor creates has no config
|
|
13
|
+
and no policy — so the agents there run with **no autonomy class and no path
|
|
14
|
+
classes at all**. Nothing is refused, nothing fails, and `git push origin main`
|
|
15
|
+
returns `PASS` on line 1213 of the gate. Measured: four worktrees, four ungated
|
|
16
|
+
implementers, and no way for the operator to see it.
|
|
17
|
+
|
|
18
|
+
This is the worst kind of defect this project can have, because Tyran's whole
|
|
19
|
+
argument is that the boundary is a mechanism rather than a promise — and here
|
|
20
|
+
it was absent precisely where the most agents run.
|
|
21
|
+
|
|
22
|
+
Three changes, none of which touch the gate:
|
|
23
|
+
|
|
24
|
+
- `doctor --state` gains **`tyran-dir-untracked`** (warning): git is asked
|
|
25
|
+
whether anything under `.tyran/` is tracked. It returns *no answer* outside a
|
|
26
|
+
work tree rather than inventing one, the same discipline the lockfile rule
|
|
27
|
+
below uses;
|
|
28
|
+
- `/tyran:setup` now ends by asking for the commit, **with the reason**, rather
|
|
29
|
+
than leaving `.tyran/` sitting untracked;
|
|
30
|
+
- the conductor treats a worktree without `.tyran/` as a precondition failure,
|
|
31
|
+
and is told to fix it by committing on the main checkout — not by copying the
|
|
32
|
+
file in, which just makes four divergent configs one layer down.
|
|
33
|
+
|
|
34
|
+
### Two inferences that produced a broken gate
|
|
35
|
+
|
|
36
|
+
**A validation command that watches does not fail an agent, it hangs it.**
|
|
37
|
+
Setup wrote `pnpm test` into a repo whose `test` script is bare `vitest` —
|
|
38
|
+
watch mode, no output, no timeout, a session that simply stops. `detectValidation`
|
|
39
|
+
now reroutes to a run-once variant (`test:run`, `test:ci`, `test:once`) and, if
|
|
40
|
+
there is none, **leaves the command out** and flags the config rather than
|
|
41
|
+
writing a booby trap. The rule is deliberately narrow — `jest` runs once by
|
|
42
|
+
default and is not treated as a watcher — because a false positive here silently
|
|
43
|
+
drops a real test command.
|
|
44
|
+
|
|
45
|
+
**A lockfile on disk is not evidence that it is the repo's lockfile.** The same
|
|
46
|
+
install had `pnpm-lock.yaml` gitignored and untracked alongside the tracked
|
|
47
|
+
`package-lock.json` that its deploy actually builds from, and `.gitignore` said
|
|
48
|
+
so in words. Picking by disk order chose pnpm, and then every single validation
|
|
49
|
+
command was wrong. `detectPackageManager` now asks git which lockfiles are
|
|
50
|
+
tracked and says which one it rejected. An empty `git ls-files` means git could
|
|
51
|
+
not answer and changes nothing — "not a git repo" is not evidence that a file is
|
|
52
|
+
ignored.
|
|
53
|
+
|
|
54
|
+
Both replay clean against the repository that produced them.
|
|
55
|
+
|
|
56
|
+
### Errors that named the wrong cause
|
|
57
|
+
|
|
58
|
+
`yaml-lite` answered every unbalanced quote with *"quote the whole value if it
|
|
59
|
+
contains an apostrophe"*. An operator writing a long `source:` as a multi-line
|
|
60
|
+
double-quoted string was sent hunting an apostrophe that did not exist, three
|
|
61
|
+
times. A value that opens a quote and never closes it now says exactly that,
|
|
62
|
+
and says the subset has no multi-line scalars. The apostrophe advice survives
|
|
63
|
+
only on the case it is actually about.
|
|
64
|
+
|
|
65
|
+
`doctor.mjs` with no flag printed *"--state is the only mode today"* long after
|
|
66
|
+
`--hooks` shipped, sending readers to look for a flag they already had.
|
|
67
|
+
|
|
68
|
+
The generated `config.yaml` header now states the YAML subset and asks for the
|
|
69
|
+
commit, since both traps are sprung by hand-editing a file whose constraints
|
|
70
|
+
were documented somewhere else.
|
|
71
|
+
|
|
72
|
+
### Still open, deliberately
|
|
73
|
+
|
|
74
|
+
The report also found that the gate matches on command TEXT, so `ls -1 .npmrc`
|
|
75
|
+
is refused as a credential read though it reads nothing, and that a `GATED`
|
|
76
|
+
refusal tells an agent to write a diff for the operator while `outside this
|
|
77
|
+
repository is never autonomous` refuses the scratch directory that is the
|
|
78
|
+
obvious place to put it. That second one is self-defeating and worth fixing.
|
|
79
|
+
Both are changes to refusal semantics in a KERNEL file and are not being made
|
|
80
|
+
in the same pass as everything above.
|
|
81
|
+
|
|
3
82
|
## 0.1.1 — 2026-07-29
|
|
4
83
|
|
|
5
84
|
Both entries below come from one install of 0.1.0 on a real repository. The
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jjanczur/tyran",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Command-line scripts for the Tyran task conductor (doctor, journal, schema, and repo tooling) for CI and terminals outside Claude Code. Installing this package does NOT install the Claude Code plugin — add that separately with `/plugin marketplace add jjanczur/tyran` inside Claude Code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
package/scripts/doctor.mjs
CHANGED
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
STATE_FILE,
|
|
50
50
|
} from './project.mjs';
|
|
51
51
|
import { classifyPath, normalizePath, validateFile, MANDATORY_KERNEL_PATHS } from './schema.mjs';
|
|
52
|
+
import { gitRunner } from './scan-repo.mjs';
|
|
52
53
|
|
|
53
54
|
/** Severity order is also the report order. `info` never fails the check. */
|
|
54
55
|
export const SEVERITIES = Object.freeze(['error', 'warning', 'info']);
|
|
@@ -178,6 +179,7 @@ export const SEVERITY_BY_CODE = Object.freeze(
|
|
|
178
179
|
// Not `info`, which is what it was: with `.tyran/` on disk and no policy
|
|
179
180
|
// under it the gate refuses every write in the repository. A severity that
|
|
180
181
|
// does not fail the check reports a locked-out repo as a note.
|
|
182
|
+
'tyran-dir-untracked': 'warning',
|
|
181
183
|
'policy-missing': 'error',
|
|
182
184
|
'policy-invalid': 'error',
|
|
183
185
|
'policy-unreadable': 'error',
|
|
@@ -983,7 +985,31 @@ function policyFindings(path, repoRoot) {
|
|
|
983
985
|
* Run every state check. Pure with respect to time: `now` is either given
|
|
984
986
|
* or taken from each journal's last event, never from the clock.
|
|
985
987
|
*/
|
|
986
|
-
|
|
988
|
+
/**
|
|
989
|
+
* Is `.tyran/` committed? The one Tyran failure that is completely silent.
|
|
990
|
+
*
|
|
991
|
+
* `git worktree add` carries TRACKED files only, and the policy gate is
|
|
992
|
+
* deliberately silent in a repository with no `.tyran/` directory. Put those
|
|
993
|
+
* two together and an uncommitted `.tyran/` means every worktree the conductor
|
|
994
|
+
* creates runs with no autonomy class and no path classes — nothing fails,
|
|
995
|
+
* nothing is refused, the boundary is simply absent in the one place the most
|
|
996
|
+
* agents run. Measured on a real install: four worktrees, four ungated
|
|
997
|
+
* implementers, and the operator had no way to see it.
|
|
998
|
+
*
|
|
999
|
+
* Returns null when git cannot answer. The distinction matters exactly as it
|
|
1000
|
+
* does in `detectPackageManager`: "this is not a git repository" is not
|
|
1001
|
+
* evidence that a file is untracked, and reporting it as such would fire on
|
|
1002
|
+
* every temp directory and every fresh `git init`.
|
|
1003
|
+
*/
|
|
1004
|
+
export function untrackedTyranDir(repoRoot, run) {
|
|
1005
|
+
if (run(['rev-parse', '--is-inside-work-tree']).trim() !== 'true') return null;
|
|
1006
|
+
// `ls-files` over the directory: any tracked file under it means the tree
|
|
1007
|
+
// travels with a worktree, which is the property being checked. Asking about
|
|
1008
|
+
// config.yaml alone would pass a repo that committed only the policy.
|
|
1009
|
+
return run(['ls-files', '--', '.tyran']).trim() === '';
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
export function runStateChecks({ dir = '.tyran', now = null, staleHours = DEFAULT_STALE_HOURS, run = null } = {}) {
|
|
987
1013
|
const root = resolve(dir);
|
|
988
1014
|
if (!existsSync(root)) {
|
|
989
1015
|
return summarize(dir, [finding('no-state-dir', show(dir), 'no Tyran state directory here — nothing to check')], [
|
|
@@ -1012,6 +1038,21 @@ export function runStateChecks({ dir = '.tyran', now = null, staleHours = DEFAUL
|
|
|
1012
1038
|
checked.push('config.yaml: absent');
|
|
1013
1039
|
}
|
|
1014
1040
|
|
|
1041
|
+
const untracked = untrackedTyranDir(repoRoot, run ?? gitRunner(repoRoot));
|
|
1042
|
+
if (untracked === true) {
|
|
1043
|
+
findings.push(
|
|
1044
|
+
finding(
|
|
1045
|
+
'tyran-dir-untracked',
|
|
1046
|
+
show(dir),
|
|
1047
|
+
'nothing under .tyran/ is tracked by git — `git worktree add` carries tracked files only, and ' +
|
|
1048
|
+
'the policy gate is silent in a repo with no .tyran/, so every worktree runs with no autonomy ' +
|
|
1049
|
+
'class and no path classes. Nothing fails; the boundary is absent where the most agents run',
|
|
1050
|
+
`git add ${sq(dir)} && git commit -m 'chore: adopt Tyran'`,
|
|
1051
|
+
),
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
checked.push(`.tyran/ tracked by git: ${untracked === null ? 'unknown (not a git work tree)' : !untracked}`);
|
|
1055
|
+
|
|
1015
1056
|
const knowledge = yamlFilesIn(join(dir, 'knowledge'), 'knowledge');
|
|
1016
1057
|
findings.push(...knowledge.findings);
|
|
1017
1058
|
for (const file of knowledge.files) findings.push(...checkSchemaFile('knowledge', file).findings);
|
|
@@ -1224,8 +1265,13 @@ function main() {
|
|
|
1224
1265
|
if (err instanceof UsageError) {
|
|
1225
1266
|
console.error(
|
|
1226
1267
|
'usage: doctor.mjs --state [--dir <.tyran>] [--json] [--now <iso>] [--stale-hours <n>]\n' +
|
|
1227
|
-
' --
|
|
1228
|
-
'
|
|
1268
|
+
' doctor.mjs --hooks [--plugin-root <dir>] [--json]\n' +
|
|
1269
|
+
'\n' +
|
|
1270
|
+
' A mode is REQUIRED: `--state` asks whether the record of the work is\n' +
|
|
1271
|
+
' consistent, `--hooks` whether the gates can fire at all. They answer\n' +
|
|
1272
|
+
' different questions, and a bare invocation would have to pick one\n' +
|
|
1273
|
+
' silently. This text said `--state is the only mode today` long after\n' +
|
|
1274
|
+
' `--hooks` shipped, which sent readers looking for a flag they had.',
|
|
1229
1275
|
);
|
|
1230
1276
|
process.exit(2);
|
|
1231
1277
|
}
|
package/scripts/scan-repo.mjs
CHANGED
|
@@ -92,9 +92,57 @@ export function gitRunner(dir) {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
/** The repo's tracked files as a Set, or null when git could not answer. */
|
|
96
|
+
export function trackedFiles(run) {
|
|
97
|
+
const listing = run(['ls-files']);
|
|
98
|
+
if (listing === '') return null;
|
|
99
|
+
return new Set(listing.split('\n').filter((line) => line !== ''));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Which package manager this repo actually uses.
|
|
104
|
+
*
|
|
105
|
+
* A lockfile being ON DISK is not evidence that it is the repo's lockfile.
|
|
106
|
+
* Measured on a real install: the repo had both `pnpm-lock.yaml` and
|
|
107
|
+
* `package-lock.json`, `pnpm-lock.yaml` was gitignored and untracked, and
|
|
108
|
+
* `.gitignore` said in words that the npm lockfile was authoritative. Picking
|
|
109
|
+
* by disk order chose pnpm, and then EVERY validation command was wrong —
|
|
110
|
+
* `pnpm lint`, `pnpm typecheck`, `pnpm test` in a repo with no pnpm.
|
|
111
|
+
*
|
|
112
|
+
* So git is asked which lockfiles it tracks, and a tracked one wins. The
|
|
113
|
+
* distinction that keeps this honest: `git ls-files` returning NOTHING means
|
|
114
|
+
* git could not answer (no repository, nothing committed yet), and no
|
|
115
|
+
* conclusion is drawn from it. A non-empty listing that omits a lockfile is
|
|
116
|
+
* positive evidence that the file is ignored or untracked, and that is the
|
|
117
|
+
* only case that changes the answer.
|
|
118
|
+
*/
|
|
119
|
+
export function detectPackageManager(dir, run = gitRunner(dir)) {
|
|
120
|
+
const present = Object.entries(LOCKFILES).filter(([file]) => existsSync(join(dir, file)));
|
|
121
|
+
if (present.length > 0) {
|
|
122
|
+
const tracked = trackedFiles(run);
|
|
123
|
+
if (tracked === null) {
|
|
124
|
+
const [file, manager] = present[0];
|
|
125
|
+
return provenance(manager, `lockfile: ${file}`, 0.95);
|
|
126
|
+
}
|
|
127
|
+
const inGit = present.filter(([file]) => tracked.has(file));
|
|
128
|
+
if (inGit.length > 0) {
|
|
129
|
+
const [file, manager] = inGit[0];
|
|
130
|
+
const ignored = present.filter(([f]) => !tracked.has(f)).map(([f]) => f);
|
|
131
|
+
const source =
|
|
132
|
+
ignored.length === 0
|
|
133
|
+
? `lockfile: ${file}`
|
|
134
|
+
: `lockfile: ${file} — tracked by git, unlike ${ignored.join(', ')}, which git does not track`;
|
|
135
|
+
return provenance(manager, source, 0.95);
|
|
136
|
+
}
|
|
137
|
+
// On disk, none of them committed. Something is the answer here, but the
|
|
138
|
+
// repository is not saying which — so it is a flagged guess, not a fact.
|
|
139
|
+
const [file, manager] = present[0];
|
|
140
|
+
return provenance(
|
|
141
|
+
manager,
|
|
142
|
+
`lockfile: ${file}, but git tracks no lockfile at all — this one may be ignored`,
|
|
143
|
+
0.4,
|
|
144
|
+
true,
|
|
145
|
+
);
|
|
98
146
|
}
|
|
99
147
|
if (existsSync(join(dir, 'package.json'))) {
|
|
100
148
|
return provenance('npm', 'package.json with no lockfile — npm assumed', 0.5, true);
|
|
@@ -119,12 +167,77 @@ export function readPackageJson(dir) {
|
|
|
119
167
|
* gate is noise. When nothing can be read, the list comes back empty and
|
|
120
168
|
* flagged rather than filled in with `npm test`.
|
|
121
169
|
*/
|
|
170
|
+
/**
|
|
171
|
+
* Suffixes a repo uses for "the same thing, but it exits". Tried in order.
|
|
172
|
+
*/
|
|
173
|
+
export const RUN_ONCE_SUFFIXES = Object.freeze([':run', ':ci', ':once']);
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Why this script would never return, or null.
|
|
177
|
+
*
|
|
178
|
+
* This is the single most dangerous inference the scanner can make. A
|
|
179
|
+
* validation command that watches instead of exiting does not fail the agent
|
|
180
|
+
* that runs it — it HANGS it, with no output and no timeout, and the operator
|
|
181
|
+
* sees a session that has simply stopped. Measured on a real install: setup
|
|
182
|
+
* wrote `pnpm test`, whose script was bare `vitest`, and every agent handed
|
|
183
|
+
* that gate would have waited forever.
|
|
184
|
+
*
|
|
185
|
+
* Deliberately narrow, because a false positive here drops a real test command
|
|
186
|
+
* out of the config. `jest` is NOT listed: it runs once by default and only
|
|
187
|
+
* watches when told to, so the explicit-flag rule below already covers it.
|
|
188
|
+
*/
|
|
189
|
+
export function watchModeProblem(script) {
|
|
190
|
+
const text = String(script);
|
|
191
|
+
if (/(^|[\s;&|])nodemon(\s|$)/.test(text)) return 'runs `nodemon`, which watches and never exits';
|
|
192
|
+
if (/--watch(All|-all)?\b(?!=false)/.test(text)) return 'passes --watch, so it never exits';
|
|
193
|
+
// `vitest` with no subcommand is watch mode outside CI. `vitest run`,
|
|
194
|
+
// `vitest bench` and an explicit `--run` all terminate.
|
|
195
|
+
if (/(^|[\s;&|])vitest(\s|$)/.test(text) && !/(^|\s)vitest\s+(run|bench|related)\b/.test(text) && !/--run\b/.test(text)) {
|
|
196
|
+
return 'is bare `vitest`, which defaults to watch mode and never exits';
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The script to actually run for `name`, avoiding a watcher.
|
|
203
|
+
*
|
|
204
|
+
* Returns `{ script, note }` — `script` null when every candidate watches,
|
|
205
|
+
* which is a command deliberately LEFT OUT rather than written into a config
|
|
206
|
+
* where it would hang the first agent that trusted it.
|
|
207
|
+
*/
|
|
208
|
+
export function resolveValidationScript(scripts, name) {
|
|
209
|
+
const problem = watchModeProblem(scripts[name]);
|
|
210
|
+
if (problem === null) return { script: name, note: null };
|
|
211
|
+
for (const suffix of RUN_ONCE_SUFFIXES) {
|
|
212
|
+
const alternate = `${name}${suffix}`;
|
|
213
|
+
if (typeof scripts[alternate] === 'string' && watchModeProblem(scripts[alternate]) === null) {
|
|
214
|
+
return { script: alternate, note: `\`${name}\` ${problem}, so \`${alternate}\` is used instead` };
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return { script: null, note: `\`${name}\` ${problem}, and no run-once variant exists — left out` };
|
|
218
|
+
}
|
|
219
|
+
|
|
122
220
|
export function detectValidation(dir, pkg, manager) {
|
|
123
221
|
const scripts = pkg?.scripts;
|
|
124
222
|
if (scripts && typeof scripts === 'object') {
|
|
125
223
|
const prefix = RUN_PREFIX[manager] ?? 'npm run';
|
|
126
|
-
const found =
|
|
127
|
-
|
|
224
|
+
const found = [];
|
|
225
|
+
const notes = [];
|
|
226
|
+
let dropped = false;
|
|
227
|
+
for (const name of VALIDATION_SCRIPTS) {
|
|
228
|
+
if (typeof scripts[name] !== 'string') continue;
|
|
229
|
+
const { script, note } = resolveValidationScript(scripts, name);
|
|
230
|
+
if (note !== null) notes.push(note);
|
|
231
|
+
if (script === null) dropped = true;
|
|
232
|
+
else found.push(`${prefix} ${script}`);
|
|
233
|
+
}
|
|
234
|
+
if (found.length > 0 || notes.length > 0) {
|
|
235
|
+
const base = `package.json scripts: ${found.length} of the usual names`;
|
|
236
|
+
const source = notes.length === 0 ? base : `${base}. ${notes.join('; ')}`;
|
|
237
|
+
// A dropped command means this repo's validation is INCOMPLETE, and the
|
|
238
|
+
// operator is the only one who can say what to run instead.
|
|
239
|
+
return provenance(found, source, dropped ? 0.6 : 0.9, dropped);
|
|
240
|
+
}
|
|
128
241
|
}
|
|
129
242
|
if (existsSync(join(dir, 'Makefile'))) {
|
|
130
243
|
try {
|
|
@@ -202,7 +315,7 @@ export function detectAutonomy(dir, run = gitRunner(dir)) {
|
|
|
202
315
|
/** The whole scan. Returns `{config, languages, questions}`. */
|
|
203
316
|
export function scanRepo(dir, { run = gitRunner(dir) } = {}) {
|
|
204
317
|
const pkg = readPackageJson(dir);
|
|
205
|
-
const manager = detectPackageManager(dir);
|
|
318
|
+
const manager = detectPackageManager(dir, run);
|
|
206
319
|
const validation = detectValidation(dir, pkg, manager?.value);
|
|
207
320
|
const autonomy = detectAutonomy(dir, run);
|
|
208
321
|
const languages = detectLanguages(dir, run);
|
|
@@ -237,6 +350,16 @@ export function renderConfig(config) {
|
|
|
237
350
|
'# Written by /tyran:setup. Inferred values carry provenance so you can\n' +
|
|
238
351
|
'# audit where each one came from. Edit freely — your edits win.\n' +
|
|
239
352
|
'#\n' +
|
|
353
|
+
'# EDITING BY HAND: Tyran parses a small YAML subset. Block scalars (>- and\n' +
|
|
354
|
+
'# |-) are REJECTED, and a file this parser cannot read makes the policy\n' +
|
|
355
|
+
'# gate refuse every write in this repository. Keep each `source:` on ONE\n' +
|
|
356
|
+
'# line, single-quoted, however long it gets.\n' +
|
|
357
|
+
'#\n' +
|
|
358
|
+
'# COMMIT THIS DIRECTORY. `.tyran/` is your repo\'s data, and an untracked\n' +
|
|
359
|
+
'# one does not reach `git worktree add` — agents then run there with no\n' +
|
|
360
|
+
'# autonomy class at all, which is the boundary silently missing exactly\n' +
|
|
361
|
+
'# where the most agents run.\n' +
|
|
362
|
+
'#\n' +
|
|
240
363
|
'# Validate: node scripts/schema.mjs validate config .tyran/config.yaml\n' +
|
|
241
364
|
'# Resolve a role to a model: node scripts/tiers.mjs --role reviewer\n' +
|
|
242
365
|
'\n' +
|
package/scripts/yaml-lite.mjs
CHANGED
|
@@ -133,7 +133,28 @@ function stripComment(line, lineNo) {
|
|
|
133
133
|
// YAML loader (`a: don't ask # why`) — refuse rather than guess
|
|
134
134
|
// (review E2S2 note 1).
|
|
135
135
|
if (inSingle || inDouble) {
|
|
136
|
-
|
|
136
|
+
// Name the construct, not one guess at its cause.
|
|
137
|
+
//
|
|
138
|
+
// This said "quote the whole value if it contains an apostrophe" for every
|
|
139
|
+
// unbalanced quote there is. Measured on a real install: an operator wrote
|
|
140
|
+
// a long `source:` as a multi-line double-quoted string, got told to worry
|
|
141
|
+
// about an apostrophe that was not there, and burned three round-trips
|
|
142
|
+
// looking for one. A diagnosis that confidently names the wrong cause is
|
|
143
|
+
// worse than one that names none — it sends the reader somewhere else.
|
|
144
|
+
//
|
|
145
|
+
// The two cases are distinguishable from what is already known here: a
|
|
146
|
+
// value that OPENS with the quote still in flight was never closed on this
|
|
147
|
+
// line, which in a subset with no multi-line scalars is the whole answer.
|
|
148
|
+
const opener = inSingle ? "'" : '"';
|
|
149
|
+
const body = line.slice(line.indexOf(':') + 1).trim();
|
|
150
|
+
const opensWithQuote = body.startsWith(opener);
|
|
151
|
+
throw new YamlLiteError(
|
|
152
|
+
opensWithQuote
|
|
153
|
+
? `a ${opener}-quoted value that never closes on this line. This subset has no multi-line ` +
|
|
154
|
+
'scalars (no >-, no |), so put the whole value on one line however long it gets'
|
|
155
|
+
: `unbalanced ${opener} — if the value contains an apostrophe, quote the whole value`,
|
|
156
|
+
lineNo,
|
|
157
|
+
);
|
|
137
158
|
}
|
|
138
159
|
return cut === -1 ? line : line.slice(0, cut);
|
|
139
160
|
}
|
package/skills/run/SKILL.md
CHANGED
|
@@ -236,6 +236,16 @@ open one.
|
|
|
236
236
|
sets only; a git worktree per agent; shared zones (per the manifest in
|
|
237
237
|
`PLAN.md`) are APPEND-ONLY and serialized; a branch per story; rebase
|
|
238
238
|
before merge.
|
|
239
|
+
- **A worktree without `.tyran/` is an UNGATED worktree.** `git worktree
|
|
240
|
+
add` carries tracked files only, so an uncommitted `.tyran/` does not
|
|
241
|
+
reach one — and the policy gate is deliberately silent in a repo that has
|
|
242
|
+
no `.tyran/` at all. The agents there then run with no autonomy class and
|
|
243
|
+
no path classes: nothing fails, the boundary is simply absent, in the one
|
|
244
|
+
place you are running the most agents. Measured on a real install: four
|
|
245
|
+
worktrees, four ungated implementers. So **check every worktree you
|
|
246
|
+
create** and, if `.tyran/` is missing, get it committed on the main
|
|
247
|
+
checkout first rather than copying it in — a copy makes four divergent
|
|
248
|
+
configs, which is the same defect one layer down.
|
|
239
249
|
- **Leases are files.** Every worktree and every heavy slot has
|
|
240
250
|
`.tyran/initiatives/<slug>/locks/<resource>.lease` holding holder,
|
|
241
251
|
purpose, story and expiry. A handoff BEGINS by taking the lease — an
|
package/skills/setup/SKILL.md
CHANGED
|
@@ -108,3 +108,25 @@ you asked about, that both `.tyran/` files are in place and validate, whether
|
|
|
108
108
|
the shortcut was installed, and what to run next. Paste the raw output of the
|
|
109
109
|
commands above — the evidence contract binds you exactly as it binds every
|
|
110
110
|
agent you will spawn.
|
|
111
|
+
|
|
112
|
+
## 6. Tell the operator to commit `.tyran/`, and say why
|
|
113
|
+
|
|
114
|
+
End by asking for one commit of `.tyran/`. This is not tidiness, and the
|
|
115
|
+
reason is the one failure mode of this whole setup that is **silent**:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git add .tyran && git commit -m "chore: adopt Tyran"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`git worktree add` does not carry untracked files. Tyran's parallel model is
|
|
122
|
+
worktrees, so an uncommitted `.tyran/` means every worktree the conductor
|
|
123
|
+
creates has no config and no policy — and a repo with no `.tyran/` is a repo
|
|
124
|
+
the policy gate deliberately says nothing about. The agents running in those
|
|
125
|
+
worktrees then have no autonomy class and no path classes at all. Nothing
|
|
126
|
+
fails; the boundary is simply not there, in exactly the place the most agents
|
|
127
|
+
run. Measured on a real install: four worktrees, four ungated implementers.
|
|
128
|
+
|
|
129
|
+
Until it is committed there is a second hazard worth naming in your report: an
|
|
130
|
+
agent that runs `git add -A` on a story branch sweeps the untracked `.tyran/`
|
|
131
|
+
into that branch, and a four-way parallel run ends with four conflicting
|
|
132
|
+
copies of the config. Stage explicit paths until this commit exists.
|