@jjanczur/tyran 0.1.40 → 0.1.43
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 +316 -0
- package/README.md +13 -3
- package/agents/implementer.md +5 -2
- package/agents/retro.md +9 -6
- package/agents/reviewer.md +3 -1
- package/agents/scout.md +2 -1
- package/agents/verifier.md +2 -1
- package/bin/tyran.mjs +1 -1
- package/hooks/HOOK-CONTRACT-MEASURED.md +6 -1
- package/hooks/scripts/hook-io.mjs +66 -8
- package/hooks/scripts/policy-gate.mjs +141 -9
- package/package.json +4 -1
- package/scripts/board-html.mjs +264 -19
- package/scripts/board.mjs +134 -6
- package/scripts/doctor.mjs +164 -5
- package/scripts/journal.mjs +17 -1
- package/scripts/knowledge.mjs +219 -20
- package/scripts/project.mjs +9 -1
- package/scripts/scan-repo.mjs +17 -1
- package/scripts/schema.mjs +125 -3
- package/scripts/settings.mjs +114 -3
- package/skills/retro/SKILL.md +26 -0
- package/skills/run/SKILL.md +4 -2
- package/skills/setup/SKILL.md +20 -0
- package/templates/config.yaml +28 -0
- package/templates/knowledge.yaml +5 -0
package/scripts/scan-repo.mjs
CHANGED
|
@@ -33,7 +33,7 @@ import { execFileSync } from 'node:child_process';
|
|
|
33
33
|
import { join, resolve, dirname, extname, relative } from 'node:path';
|
|
34
34
|
import { fileURLToPath } from 'node:url';
|
|
35
35
|
import { parse, stringify } from './yaml-lite.mjs';
|
|
36
|
-
import { validatePolicy } from './schema.mjs';
|
|
36
|
+
import { BOUNDARIES_STRICT, validatePolicy } from './schema.mjs';
|
|
37
37
|
import { escapeInvisible } from './invisible.mjs';
|
|
38
38
|
import { handleArgs } from './cli-args.mjs';
|
|
39
39
|
|
|
@@ -356,6 +356,15 @@ export function scanRepo(dir, { run = gitRunner(dir) } = {}) {
|
|
|
356
356
|
tiers: { cheap: 'haiku', work: 'sonnet', deep: 'opus', top: 'fable' },
|
|
357
357
|
validation,
|
|
358
358
|
shared_zones: [],
|
|
359
|
+
// Every boundary ON, written out in full for the same reason `limits:` is
|
|
360
|
+
// below: the Settings tab patches keys that exist and refuses to invent
|
|
361
|
+
// them, so an absent block is a section of the dashboard nobody can use.
|
|
362
|
+
//
|
|
363
|
+
// Nothing here is inferred and nothing here is ever inferred. A scanner
|
|
364
|
+
// that could conclude "this repo looks like it wants its credentials
|
|
365
|
+
// readable" is a scanner that opens a boundary on evidence, and the
|
|
366
|
+
// evidence for opening one is a person deciding to.
|
|
367
|
+
boundaries: { preset: 'strict', ...BOUNDARIES_STRICT },
|
|
359
368
|
// Written out in full, every value at its shipped default, with the
|
|
360
369
|
// feature OFF. Nothing here enables anything — `mode: 'off'` is the same
|
|
361
370
|
// inert state as omitting the block entirely.
|
|
@@ -548,6 +557,13 @@ export function renderConfig(config) {
|
|
|
548
557
|
'# autonomy class at all, which is the boundary silently missing exactly\n' +
|
|
549
558
|
'# where the most agents run.\n' +
|
|
550
559
|
'#\n' +
|
|
560
|
+
'# GIVING AGENTS MORE ROOM: `boundaries:` below is the one place the policy\n' +
|
|
561
|
+
'# gate can be turned down. `preset: open` relaxes all five at once — the\n' +
|
|
562
|
+
'# closest thing to running with permissions skipped. Secret scanning at\n' +
|
|
563
|
+
'# commit and push, the enforcement hooks, `.claude/settings.json` and\n' +
|
|
564
|
+
'# `.tyran/STOP` are NOT reachable from it, whatever it is set to.\n' +
|
|
565
|
+
'# See docs/configuration.md.\n' +
|
|
566
|
+
'#\n' +
|
|
551
567
|
'# Validate: node scripts/schema.mjs validate config .tyran/config.yaml\n' +
|
|
552
568
|
'# Resolve a role to a model: node scripts/tiers.mjs --role reviewer\n' +
|
|
553
569
|
'\n' +
|
package/scripts/schema.mjs
CHANGED
|
@@ -34,6 +34,35 @@ export const TIER_KEYS = Object.freeze(['cheap', 'work', 'deep', 'top']);
|
|
|
34
34
|
export const ARTIFACT_CLASSES = Object.freeze(['AUTO', 'GATED', 'KERNEL']);
|
|
35
35
|
export const KNOWLEDGE_KINDS = Object.freeze(['fact', 'convention', 'gotcha', 'command', 'decision']);
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* `boundaries:` — how far down the policy gate's refusals may be turned.
|
|
39
|
+
*
|
|
40
|
+
* One block, because the alternative measured badly on real installs: an
|
|
41
|
+
* operator who wants agents to read a neighbouring project's files has no
|
|
42
|
+
* business learning what `main_writable_paths` is, and the answer to "let it
|
|
43
|
+
* do everything" must not be five unrelated edits in four files.
|
|
44
|
+
*
|
|
45
|
+
* Every flag is spelled the same way — the strict value first, so a reader
|
|
46
|
+
* scanning the list knows which column is the default without consulting a
|
|
47
|
+
* table. `prompts` is the odd one because it is not a refusal knob at all: it
|
|
48
|
+
* decides whether a call this gate has NO objection to still renders the
|
|
49
|
+
* platform's own permission prompt.
|
|
50
|
+
*/
|
|
51
|
+
export const BOUNDARY_PRESETS = Object.freeze(['strict', 'open']);
|
|
52
|
+
export const BOUNDARY_VALUES = Object.freeze(['refuse', 'allow']);
|
|
53
|
+
export const BOUNDARY_PROMPTS = Object.freeze(['ask', 'skip']);
|
|
54
|
+
/** The four refusal flags, in the order they are documented. */
|
|
55
|
+
export const BOUNDARY_FLAGS = Object.freeze(['outside_repo', 'credentials', 'path_classes', 'push']);
|
|
56
|
+
/** Every key legal inside the block. */
|
|
57
|
+
export const BOUNDARY_KEYS = Object.freeze(['preset', ...BOUNDARY_FLAGS, 'prompts']);
|
|
58
|
+
/** What each preset resolves to before per-key overrides are applied. */
|
|
59
|
+
const BOUNDARY_BY_PRESET = Object.freeze({
|
|
60
|
+
strict: Object.freeze({ outside_repo: 'refuse', credentials: 'refuse', path_classes: 'refuse', push: 'refuse', prompts: 'ask' }),
|
|
61
|
+
open: Object.freeze({ outside_repo: 'allow', credentials: 'allow', path_classes: 'allow', push: 'allow', prompts: 'skip' }),
|
|
62
|
+
});
|
|
63
|
+
/** The safe answer, used for an absent block and for every value the schema rejects. */
|
|
64
|
+
export const BOUNDARIES_STRICT = BOUNDARY_BY_PRESET.strict;
|
|
65
|
+
|
|
37
66
|
const isPlainObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
38
67
|
const isNonEmptyString = (v) => typeof v === 'string' && v.trim() !== '';
|
|
39
68
|
|
|
@@ -69,7 +98,7 @@ export function validateConfig(doc) {
|
|
|
69
98
|
const errors = [];
|
|
70
99
|
if (!isPlainObject(doc)) return ['config must be a mapping'];
|
|
71
100
|
|
|
72
|
-
const known = ['profile', 'autonomy', 'tiers', 'validation', 'shared_zones', 'budget', 'main_writable_paths', 'limits', 'pricing', 'spend', 'board'];
|
|
101
|
+
const known = ['profile', 'autonomy', 'tiers', 'validation', 'shared_zones', 'budget', 'main_writable_paths', 'boundaries', 'limits', 'pricing', 'spend', 'board'];
|
|
73
102
|
for (const key of Object.keys(doc)) {
|
|
74
103
|
if (!known.includes(key)) errors.push(`${key}: unknown top-level key`);
|
|
75
104
|
}
|
|
@@ -146,6 +175,30 @@ export function validateConfig(doc) {
|
|
|
146
175
|
}
|
|
147
176
|
}
|
|
148
177
|
|
|
178
|
+
// How far the policy gate's refusals may be turned down. Optional; absent
|
|
179
|
+
// means strict, which is what every install had before this block existed.
|
|
180
|
+
// Operator-written policy, never scanner-inferred — no provenance wrapper.
|
|
181
|
+
if ('boundaries' in doc) {
|
|
182
|
+
if (!isPlainObject(doc.boundaries)) errors.push('boundaries: must be a mapping');
|
|
183
|
+
else {
|
|
184
|
+
const boundaries = doc.boundaries;
|
|
185
|
+
if ('preset' in boundaries && !BOUNDARY_PRESETS.includes(boundaries.preset)) {
|
|
186
|
+
errors.push(`boundaries.preset: must be one of ${BOUNDARY_PRESETS.join(' | ')}`);
|
|
187
|
+
}
|
|
188
|
+
for (const flag of BOUNDARY_FLAGS) {
|
|
189
|
+
if (flag in boundaries && !BOUNDARY_VALUES.includes(boundaries[flag])) {
|
|
190
|
+
errors.push(`boundaries.${flag}: must be one of ${BOUNDARY_VALUES.join(' | ')}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if ('prompts' in boundaries && !BOUNDARY_PROMPTS.includes(boundaries.prompts)) {
|
|
194
|
+
errors.push(`boundaries.prompts: must be one of ${BOUNDARY_PROMPTS.join(' | ')}`);
|
|
195
|
+
}
|
|
196
|
+
for (const key of Object.keys(boundaries)) {
|
|
197
|
+
if (!BOUNDARY_KEYS.includes(key)) errors.push(`boundaries.${key}: unknown key`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
149
202
|
// Overnight mode: usage-limit pause/resume. Optional; absent = feature off.
|
|
150
203
|
// Operator-written policy, never scanner-inferred — no provenance wrapper.
|
|
151
204
|
if ('limits' in doc) {
|
|
@@ -313,6 +366,40 @@ export function boardSettings(doc) {
|
|
|
313
366
|
};
|
|
314
367
|
}
|
|
315
368
|
|
|
369
|
+
/**
|
|
370
|
+
* The boundaries block with the preset expanded and overrides applied — the
|
|
371
|
+
* ONE place the resolution rule lives, called by the policy gate, doctor, the
|
|
372
|
+
* Settings tab and anything else that needs to know how open this repo is.
|
|
373
|
+
*
|
|
374
|
+
* Two properties, and both are the security-critical direction of `limitsOf`'s
|
|
375
|
+
* doctrine rather than a copy of it:
|
|
376
|
+
*
|
|
377
|
+
* - an absent block is STRICT, so every install written before this existed
|
|
378
|
+
* keeps exactly the behaviour it had;
|
|
379
|
+
* - a value the validator rejects is treated as absent, which for a knob
|
|
380
|
+
* whose looser setting removes a refusal means it must never RELAX on
|
|
381
|
+
* input nobody can read. `credentials: yes` is not `allow`, and guessing
|
|
382
|
+
* that it is would open the secret-read rule on a typo.
|
|
383
|
+
*
|
|
384
|
+
* An explicit key beats the preset, in both directions: `preset: open` with
|
|
385
|
+
* `credentials: refuse` is a repo that wants everything except its own keys.
|
|
386
|
+
*/
|
|
387
|
+
export function boundariesOf(doc) {
|
|
388
|
+
const raw = isPlainObject(doc) && isPlainObject(doc.boundaries) ? doc.boundaries : {};
|
|
389
|
+
const base = BOUNDARY_BY_PRESET[raw.preset] ?? BOUNDARIES_STRICT;
|
|
390
|
+
const resolved = { ...base };
|
|
391
|
+
for (const flag of BOUNDARY_FLAGS) {
|
|
392
|
+
if (BOUNDARY_VALUES.includes(raw[flag])) resolved[flag] = raw[flag];
|
|
393
|
+
}
|
|
394
|
+
if (BOUNDARY_PROMPTS.includes(raw.prompts)) resolved.prompts = raw.prompts;
|
|
395
|
+
return Object.freeze(resolved);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/** Which flags are looser than strict — what a doctor finding and the board report. */
|
|
399
|
+
export function relaxedBoundaries(resolved) {
|
|
400
|
+
return Object.keys(BOUNDARIES_STRICT).filter((key) => resolved[key] !== BOUNDARIES_STRICT[key]);
|
|
401
|
+
}
|
|
402
|
+
|
|
316
403
|
export const LIMITS_MODES = Object.freeze(['off', 'warn', 'pause']);
|
|
317
404
|
export const LIMITS_LONG_WAIT = Object.freeze(['hold', 'resume']);
|
|
318
405
|
|
|
@@ -455,13 +542,48 @@ export function validateKnowledge(doc) {
|
|
|
455
542
|
if ('applies_to' in entry && !Array.isArray(entry.applies_to)) {
|
|
456
543
|
errors.push(`${at}.applies_to: must be a list of path globs`);
|
|
457
544
|
}
|
|
458
|
-
|
|
459
|
-
|
|
545
|
+
// A LIST as well as a scalar, because consolidation is many-to-one by
|
|
546
|
+
// definition: a merged entry that could retire only one predecessor
|
|
547
|
+
// cannot express the merge it was written to record. The scalar form
|
|
548
|
+
// stays legal — every entry written before this read as one id.
|
|
549
|
+
if ('supersedes' in entry) {
|
|
550
|
+
const ids = entry.supersedes;
|
|
551
|
+
if (isNonEmptyString(ids)) {
|
|
552
|
+
if (ids === entry.id) errors.push(`${at}.supersedes: an entry cannot supersede itself`);
|
|
553
|
+
} else if (Array.isArray(ids)) {
|
|
554
|
+
if (ids.length === 0) {
|
|
555
|
+
errors.push(`${at}.supersedes: must name at least one entry id`);
|
|
556
|
+
}
|
|
557
|
+
ids.forEach((id, j) => {
|
|
558
|
+
if (!isNonEmptyString(id)) errors.push(`${at}.supersedes[${j}]: must be an entry id`);
|
|
559
|
+
else if (id === entry.id) errors.push(`${at}.supersedes[${j}]: an entry cannot supersede itself`);
|
|
560
|
+
});
|
|
561
|
+
} else {
|
|
562
|
+
errors.push(`${at}.supersedes: must be an entry id, or a list of entry ids`);
|
|
563
|
+
}
|
|
460
564
|
}
|
|
461
565
|
});
|
|
462
566
|
return errors;
|
|
463
567
|
}
|
|
464
568
|
|
|
569
|
+
/**
|
|
570
|
+
* The ids an entry retires, whatever spelling it used. One home for the
|
|
571
|
+
* string-or-list branch: `selectEntries` and `auditEntries` both need it, and
|
|
572
|
+
* a second hand-rolled `Array.isArray` check is how the two would drift into
|
|
573
|
+
* disagreeing about which entries a brief may carry.
|
|
574
|
+
*
|
|
575
|
+
* Self-supersede is a validator error rather than something callers filter,
|
|
576
|
+
* so this never has to defend against the one-entry cycle. A MUTUAL pair
|
|
577
|
+
* (A→B, B→A) still validates and is reported by `knowledge.mjs audit` — a
|
|
578
|
+
* cheap named line beats teaching the selector graph theory.
|
|
579
|
+
*/
|
|
580
|
+
export function supersededIds(entry) {
|
|
581
|
+
const ids = entry?.supersedes;
|
|
582
|
+
if (typeof ids === 'string') return ids.trim() === '' ? [] : [ids];
|
|
583
|
+
if (Array.isArray(ids)) return ids.filter((id) => typeof id === 'string' && id.trim() !== '');
|
|
584
|
+
return [];
|
|
585
|
+
}
|
|
586
|
+
|
|
465
587
|
/**
|
|
466
588
|
* The size above which a knowledge entry stops being a brief-able fact and
|
|
467
589
|
* starts being a document. `knowledge.mjs brief` selects entries into a
|
package/scripts/settings.mjs
CHANGED
|
@@ -38,6 +38,9 @@ import { join } from 'node:path';
|
|
|
38
38
|
import {
|
|
39
39
|
ARTIFACT_CLASSES,
|
|
40
40
|
AUTONOMY_CLASSES,
|
|
41
|
+
BOUNDARY_PRESETS,
|
|
42
|
+
BOUNDARY_PROMPTS,
|
|
43
|
+
BOUNDARY_VALUES,
|
|
41
44
|
LIMITS_LONG_WAIT,
|
|
42
45
|
LIMITS_MODES,
|
|
43
46
|
MANDATORY_KERNEL_PATHS,
|
|
@@ -95,6 +98,11 @@ export const GROUPS = Object.freeze([
|
|
|
95
98
|
path: ['autonomy'],
|
|
96
99
|
label: 'Deployment autonomy',
|
|
97
100
|
help: 'How far a finished piece of work may travel without you. The gate enforces this downward — it will not stop someone who edits this file from raising it, which is why the policy below decides who may.',
|
|
101
|
+
widening: {
|
|
102
|
+
scale: 'autonomy',
|
|
103
|
+
consequence:
|
|
104
|
+
'A higher deployment class lets finished work travel further without you — P2 reaches staging, P3 merges to the default branch.',
|
|
105
|
+
},
|
|
98
106
|
...choice(AUTONOMY_CLASSES, {
|
|
99
107
|
P1: 'Branch only. Agents commit and push a branch; you open and merge the PR.',
|
|
100
108
|
P2: 'Through to staging. Agents may merge and deploy to a non-production environment.',
|
|
@@ -103,6 +111,101 @@ export const GROUPS = Object.freeze([
|
|
|
103
111
|
},
|
|
104
112
|
],
|
|
105
113
|
},
|
|
114
|
+
{
|
|
115
|
+
id: 'boundaries',
|
|
116
|
+
title: 'What agents may touch',
|
|
117
|
+
blurb:
|
|
118
|
+
'How far the policy gate turns its refusals down. Everything here starts at the strict setting, and every move toward the looser one asks you to confirm it a second time. Four things are NOT on this screen because no setting reaches them: secret scanning at commit and push, the enforcement hooks themselves, the file that registers them, and the STOP brake.',
|
|
119
|
+
settings: [
|
|
120
|
+
{
|
|
121
|
+
id: 'boundaries.preset',
|
|
122
|
+
path: ['boundaries', 'preset'],
|
|
123
|
+
label: 'Preset',
|
|
124
|
+
help: 'The one switch. "Open" turns every boundary below to its loose setting at once — the closest thing Tyran has to running Claude Code with permissions skipped. Anything you set individually below wins over the preset.',
|
|
125
|
+
widening: {
|
|
126
|
+
scale: 'preset',
|
|
127
|
+
consequence:
|
|
128
|
+
'OPEN lets agents read your credentials, work outside this repository, write paths your own policy gates, push anywhere, and act without a permission prompt. Secret scanning and the gate\'s own files are unaffected.',
|
|
129
|
+
},
|
|
130
|
+
...choice(BOUNDARY_PRESETS, {
|
|
131
|
+
strict: 'Every boundary on. This is what Tyran has always done.',
|
|
132
|
+
open: 'Every boundary below turned down at once.',
|
|
133
|
+
}),
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'boundaries.outside_repo',
|
|
137
|
+
path: ['boundaries', 'outside_repo'],
|
|
138
|
+
label: 'Files outside this repository',
|
|
139
|
+
help: 'Today a path outside the repo root is refused for every agent. Allowing it lets them read and write anywhere on this machine — another project, your home directory, system files.',
|
|
140
|
+
widening: {
|
|
141
|
+
scale: 'boundary',
|
|
142
|
+
consequence: 'Agents will be able to write files anywhere on this machine, not only inside this repository.',
|
|
143
|
+
},
|
|
144
|
+
...choice(BOUNDARY_VALUES, {
|
|
145
|
+
refuse: 'Agents stay inside this repository.',
|
|
146
|
+
allow: 'Agents may read and write anywhere on this machine.',
|
|
147
|
+
}),
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'boundaries.credentials',
|
|
151
|
+
path: ['boundaries', 'credentials'],
|
|
152
|
+
label: 'Credential files',
|
|
153
|
+
help: 'Today .env files, private keys, ~/.ssh, ~/.aws and their relatives are refused before they can reach the model — a transcript is storage. Allowing it also removes the false refusal where a word merely ENDING in .key or .pem is treated as a file.',
|
|
154
|
+
widening: {
|
|
155
|
+
scale: 'boundary',
|
|
156
|
+
consequence:
|
|
157
|
+
'Agents will be able to read your secrets into the conversation. What stops those bytes being COMMITTED or PUSHED is the secrets gate, which this setting does not reach.',
|
|
158
|
+
},
|
|
159
|
+
...choice(BOUNDARY_VALUES, {
|
|
160
|
+
refuse: 'Credential-shaped files never enter the conversation.',
|
|
161
|
+
allow: 'Agents may read .env files, keys and credential stores.',
|
|
162
|
+
}),
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 'boundaries.path_classes',
|
|
166
|
+
path: ['boundaries', 'path_classes'],
|
|
167
|
+
label: 'Your own path rules',
|
|
168
|
+
help: 'The AUTO / GATED / KERNEL rules in the policy below. Allowing this makes them advisory: a subagent may write a path you gated. The four paths that protect the gate itself stay refused whatever this says.',
|
|
169
|
+
widening: {
|
|
170
|
+
scale: 'boundary',
|
|
171
|
+
consequence: 'The GATED and KERNEL rules in your own policy stop being enforced for writes.',
|
|
172
|
+
},
|
|
173
|
+
...choice(BOUNDARY_VALUES, {
|
|
174
|
+
refuse: 'The classes in your policy are enforced.',
|
|
175
|
+
allow: 'Agents may write paths your policy gates.',
|
|
176
|
+
}),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 'boundaries.push',
|
|
180
|
+
path: ['boundaries', 'push'],
|
|
181
|
+
label: 'Where work may be pushed',
|
|
182
|
+
help: 'Turns off the deployment-class check on git push entirely, including the rules that gate the pushes nothing can undo — a force push to main, a deleted remote branch, a mirror push.',
|
|
183
|
+
widening: {
|
|
184
|
+
scale: 'boundary',
|
|
185
|
+
consequence:
|
|
186
|
+
'The deployment class stops being checked. Agents may force-push, delete remote branches and mirror-push, none of which can be undone.',
|
|
187
|
+
},
|
|
188
|
+
...choice(BOUNDARY_VALUES, {
|
|
189
|
+
refuse: 'Pushes are checked against the deployment autonomy above.',
|
|
190
|
+
allow: 'Any push is allowed, including the irreversible ones.',
|
|
191
|
+
}),
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: 'boundaries.prompts',
|
|
195
|
+
path: ['boundaries', 'prompts'],
|
|
196
|
+
label: 'Permission prompts',
|
|
197
|
+
help: 'Whether Claude Code still asks you before a tool call this gate has no objection to. "Skip" auto-approves those calls, which is what people mean by skipping permissions — a refusal from any gate still wins, so this cannot approve something another gate denied.',
|
|
198
|
+
widening: {
|
|
199
|
+
scale: 'prompts',
|
|
200
|
+
consequence: 'Claude Code will stop asking before it edits files or runs commands that no gate objects to.',
|
|
201
|
+
},
|
|
202
|
+
...choice(BOUNDARY_PROMPTS, {
|
|
203
|
+
ask: 'Claude Code prompts you as it normally would.',
|
|
204
|
+
skip: 'Calls no gate objects to are approved without asking.',
|
|
205
|
+
}),
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
},
|
|
106
209
|
{
|
|
107
210
|
id: 'tiers',
|
|
108
211
|
title: 'Model tiers',
|
|
@@ -246,6 +349,11 @@ const BY_ID = new Map(GROUPS.flatMap((g) => g.settings.map((s) => [s.id, s])));
|
|
|
246
349
|
const LOOSER_FIRST = Object.freeze({
|
|
247
350
|
class: Object.freeze(['AUTO', 'GATED', 'KERNEL']),
|
|
248
351
|
autonomy: Object.freeze(['P3', 'P2', 'P1']),
|
|
352
|
+
// The `boundaries:` block. Each of these turns a REFUSAL off, so the
|
|
353
|
+
// direction that needs the second act is the one that removes a check.
|
|
354
|
+
boundary: Object.freeze([...BOUNDARY_VALUES].reverse()),
|
|
355
|
+
prompts: Object.freeze([...BOUNDARY_PROMPTS].reverse()),
|
|
356
|
+
preset: Object.freeze([...BOUNDARY_PRESETS].reverse()),
|
|
249
357
|
});
|
|
250
358
|
|
|
251
359
|
function widens(scale, before, after) {
|
|
@@ -462,9 +570,12 @@ export function applySetting(tyranDir, id, value, confirm = null) {
|
|
|
462
570
|
);
|
|
463
571
|
}
|
|
464
572
|
const next = coerce(setting, value);
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
573
|
+
// Driven by the catalogue rather than by a list of ids here. The `autonomy`
|
|
574
|
+
// check used to be an `if (id === ...)`, and every knob added beside it since
|
|
575
|
+
// would have had to remember to extend that line — which is exactly how a
|
|
576
|
+
// boundary-loosening control ships with no confirmation at all.
|
|
577
|
+
if (setting.widening) {
|
|
578
|
+
requireConfirm(setting.widening.scale, before, next, confirm, setting.widening.consequence);
|
|
468
579
|
}
|
|
469
580
|
|
|
470
581
|
let text;
|
package/skills/retro/SKILL.md
CHANGED
|
@@ -66,6 +66,32 @@ here, at close, in the one place licensed to write these files. Keep entries
|
|
|
66
66
|
under the size `doctor --state` warns about (`knowledge-entry-oversized`,
|
|
67
67
|
4 000 codepoints); an oversized entry crowds every brief it matches.
|
|
68
68
|
|
|
69
|
+
**Then consolidate — by APPENDING, never by editing.** Read the audit:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
node "${CLAUDE_PLUGIN_ROOT}/scripts/knowledge.mjs" audit --dir .tyran/knowledge
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
It names the retirement candidates the counters have written off, and — if it
|
|
76
|
+
says no entry carries counter evidence — that the fold above is not actually
|
|
77
|
+
happening, which is the finding to act on first.
|
|
78
|
+
|
|
79
|
+
Deciding that two entries say the same thing is YOUR judgement; no script
|
|
80
|
+
scores it. Recording that decision is mechanical: write a **new** file,
|
|
81
|
+
`.tyran/knowledge/<slug>-merged.yaml`, whose entry states the fact once and
|
|
82
|
+
carries `supersedes:` naming every id it replaces, plus the union of their
|
|
83
|
+
`provenance`. **Do not touch the files holding the originals.** They keep
|
|
84
|
+
their bytes and the counters they earned over months, and stop reaching briefs
|
|
85
|
+
because `supersedes` retires them at read time. An entry the counters have
|
|
86
|
+
written off with nothing to replace it is a plain deletion — git holds the
|
|
87
|
+
bytes, and the counters are the argument.
|
|
88
|
+
|
|
89
|
+
Re-run the audit. Superseded should be up, `live` down, reachability up, and
|
|
90
|
+
**dangling zero** — a `supersedes` naming an id that is not in the store means
|
|
91
|
+
the retirement silently did not happen and the merge only made the store
|
|
92
|
+
bigger. Undo, if the merge was wrong, is deleting that one file: every entry
|
|
93
|
+
it retired comes back whole.
|
|
94
|
+
|
|
69
95
|
Write what a competent newcomer would get wrong, not what the code already
|
|
70
96
|
says. "The test suite takes 9 minutes, so do not run it per file" is worth an
|
|
71
97
|
entry. "This is a Next.js app" is not: the next agent can see that.
|
package/skills/run/SKILL.md
CHANGED
|
@@ -256,8 +256,10 @@ open one.
|
|
|
256
256
|
the next report, review or merge clears it.
|
|
257
257
|
- **Scout `DURABLE:` findings, you journal** as `finding` events — the
|
|
258
258
|
required keys are `area` + `claim` (the area is the path or subsystem the
|
|
259
|
-
scout's proof points at), plus that `proof` —
|
|
260
|
-
|
|
259
|
+
scout's proof points at), plus that `proof` — and, when the scout proved
|
|
260
|
+
it by running something, the `command` and its `exit_code`. Scouts write
|
|
261
|
+
nothing themselves; implementers, reviewers and verifiers append their
|
|
262
|
+
own. An operator
|
|
261
263
|
CORRECTION — a premise you had wrong, a step they had to undo — is a
|
|
262
264
|
`finding` too, with `area: process`: it is the densest mistake signal
|
|
263
265
|
there is, and the retrospective is where it becomes a `MISTAKES.md`
|
package/skills/setup/SKILL.md
CHANGED
|
@@ -248,6 +248,26 @@ agent that runs `git add -A` on a story branch sweeps the untracked `.tyran/`
|
|
|
248
248
|
into that branch, and a four-way parallel run ends with four conflicting
|
|
249
249
|
copies of the config. Stage explicit paths until this commit exists.
|
|
250
250
|
|
|
251
|
+
## 6b. Say that `boundaries:` exists, once, and do not sell it
|
|
252
|
+
|
|
253
|
+
The scan writes the block at its strict setting. Tell the operator, in one or
|
|
254
|
+
two sentences, that `.tyran/config.yaml` has a `boundaries:` block and that
|
|
255
|
+
`preset: open` relaxes all five at once — files outside the repo, credential
|
|
256
|
+
files, their own path rules, the deployment class on `git push`, and the
|
|
257
|
+
permission prompt. The Settings tab edits it, and every move toward the loose
|
|
258
|
+
value asks for a confirmation.
|
|
259
|
+
|
|
260
|
+
Say the floor in the same breath, because it is what makes the offer safe to
|
|
261
|
+
make: secret scanning at commit and push, the enforcement hooks,
|
|
262
|
+
`.claude/settings.json` and `.tyran/STOP` are unreachable from it at any
|
|
263
|
+
setting.
|
|
264
|
+
|
|
265
|
+
**Do not recommend a value, and do not ask which they want.** Strict is
|
|
266
|
+
already written and already correct; this is a pointer for the operator who
|
|
267
|
+
comes back later having hit a refusal they did not want, not a decision to
|
|
268
|
+
extract during setup. An agent that talks somebody into opening a boundary
|
|
269
|
+
during onboarding is the failure this step exists to avoid.
|
|
270
|
+
|
|
251
271
|
## 7. Offer overnight mode — and say plainly what the operator must do
|
|
252
272
|
|
|
253
273
|
Overnight mode (https://jjanczur.github.io/tyran/overnight/) pauses autonomous work near the
|
package/templates/config.yaml
CHANGED
|
@@ -43,6 +43,34 @@ validation:
|
|
|
43
43
|
# Files multiple agents may touch: append-only, serialized by the conductor.
|
|
44
44
|
shared_zones: []
|
|
45
45
|
|
|
46
|
+
# How far the policy gate turns its refusals DOWN. Every value here is the
|
|
47
|
+
# strict one, which is what Tyran did before this block existed — nothing is
|
|
48
|
+
# relaxed by having it in the file, only made editable from the Settings tab.
|
|
49
|
+
#
|
|
50
|
+
# preset: strict | open one switch. `open` sets all five below at once and
|
|
51
|
+
# is the closest thing to running with permissions
|
|
52
|
+
# skipped. Anything you set explicitly wins over it.
|
|
53
|
+
# outside_repo refuse | allow — files outside this repository
|
|
54
|
+
# credentials refuse | allow — .env, keys, ~/.ssh, ~/.aws
|
|
55
|
+
# path_classes refuse | allow — the GATED/KERNEL rules you wrote
|
|
56
|
+
# push refuse | allow — the deployment class on git push
|
|
57
|
+
# prompts ask | skip — skip Claude Code's own prompts
|
|
58
|
+
#
|
|
59
|
+
# FOUR THINGS NO SETTING HERE REACHES, whatever it says: secret scanning at
|
|
60
|
+
# commit and push, the enforcement hooks, `.claude/settings.json`, and
|
|
61
|
+
# `.tyran/STOP`. A refusal from any gate still wins over an auto-approval.
|
|
62
|
+
#
|
|
63
|
+
# This file is class AUTO, so an agent can widen these itself — the same trade
|
|
64
|
+
# `autonomy:` above already makes, and the reason the four exceptions are
|
|
65
|
+
# mechanical rather than a matter of policy. See docs/policy-gate.md.
|
|
66
|
+
boundaries:
|
|
67
|
+
preset: strict
|
|
68
|
+
outside_repo: refuse
|
|
69
|
+
credentials: refuse
|
|
70
|
+
path_classes: refuse
|
|
71
|
+
push: refuse
|
|
72
|
+
prompts: ask
|
|
73
|
+
|
|
46
74
|
# Overnight mode — pause autonomous work near the subscription usage limits
|
|
47
75
|
# and resume after the window resets (https://jjanczur.github.io/tyran/overnight/). Requires the
|
|
48
76
|
# operator-installed statusline helper (scripts/statusline.mjs), which is the
|
package/templates/knowledge.yaml
CHANGED
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
#
|
|
7
7
|
# kind: fact | convention | gotcha | command | decision
|
|
8
8
|
#
|
|
9
|
+
# To merge two entries that say one thing, APPEND a third that states it once
|
|
10
|
+
# and carries `supersedes: [K-3, K-7]`. The named entries drop out of every
|
|
11
|
+
# brief while keeping their bytes and counters, so deleting the new file
|
|
12
|
+
# brings them back. Never edit or delete the originals to merge them.
|
|
13
|
+
#
|
|
9
14
|
# Validate: node scripts/schema.mjs validate knowledge .tyran/knowledge/*.yaml
|
|
10
15
|
|
|
11
16
|
entries:
|