@jjanczur/tyran 0.1.23 → 0.1.25

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.
@@ -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.23",
14
+ "version": "0.1.25",
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.23",
3
+ "version": "0.1.25",
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,183 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.25 — 2026-08-15
4
+
5
+ ### The sandbox is now Tyran building Tyran
6
+
7
+ The published sample board was two invented initiatives about someone else's
8
+ payment system. It showed what the dashboard looked like and nothing about what
9
+ it is like to work this way, which is half of what a reader opens it for.
10
+
11
+ It now carries **three initiatives that actually built the board you are
12
+ looking at** — the lanes, overnight mode, and the Settings tab — written as
13
+ journals from the real work. Every finding on it is a finding that was made:
14
+ the artefact must never read a clock or `--check` can never pass twice; the
15
+ page must build DOM with `textContent` only, because journal values reach the
16
+ browser verbatim; the hook payload does not carry `rate_limits` and a plugin
17
+ cannot install a statusline. Every logged error is one that happened, including
18
+ the backtick in a comment that terminated the client's template literal.
19
+
20
+ All ten lanes are populated, five agents run at ages from two minutes to three
21
+ hours, two questions wait on the operator, and the banner's counts are read
22
+ from the payload rather than typed — it said "two invented initiatives" for a
23
+ release after a third was added.
24
+
25
+ ### Three findings while writing those journals, all in shipped code
26
+
27
+ - **Every reviewer on the published sandbox rendered as still running, for
28
+ ever.** A `review` closes its spawn by `data.by`; the sandbox journals said
29
+ `data.agent`, so no review ever closed anything and the headline agent count
30
+ was wrong on the one page whose job is to show what the product looks like.
31
+ - **The test that was supposed to catch that validated nothing.**
32
+ `validateJournal` takes a file PATH and the test handed it an array of
33
+ events, so it read an empty journal and returned `ok`. It has been passing
34
+ against journals carrying thirteen real errors.
35
+ - **An `error` event that named a ticket produced two rows on the board**, one
36
+ from `state.errors` and one from `unknownErrorTickets`. The ticket now
37
+ travels on the error itself, where a consumer that wants both can have both
38
+ without joining two lists by timestamp.
39
+
40
+ ### The board answers "is this supposed to be running?"
41
+
42
+ Three chips reading "6 HOURS since last signal — likely dead" covered four
43
+ unrelated situations and the board could tell them apart in none of them.
44
+
45
+ - **A STOP is on the board**, above everything else, carrying the first line of
46
+ `.tyran/STOP` as its reason. It is committed repo state, identical in every
47
+ clone, so it travels in the artefact — as `{stopped, reason}` and
48
+ deliberately not the path, which would make two clones disagree and fail
49
+ `--check`.
50
+ - **An error with no ticket is finally visible.** The fold has collected
51
+ `state.errors` since errors existed and the board carried neither it nor the
52
+ unknown-ticket list, so an agent logging a hard failure showed nothing at all
53
+ on the page that exists to say "not all is well". The key is
54
+ `errors_logged`, not `errors`: that name already means "this journal could
55
+ not be read", and one key with two meanings is the defect ADR-21 is named
56
+ after. Capped at 20 newest-first with the true count beside it, because this
57
+ artefact is committed.
58
+ - **Cards say how long they have stood still.** The board would tell you an
59
+ agent had been quiet for three hours and refuse to tell you a ticket had been
60
+ blocked for four days — the timestamp was in `board.json` all along. Only on
61
+ the lanes where standing still IS the defect: `backlog` and `ready` are
62
+ excluded, because an unstarted ticket is waiting its turn, and marking every
63
+ one of them stale makes the mark worthless where it means something.
64
+
65
+ All three use one staleness vocabulary, shared with the agent strip. Three
66
+ renderings of "how long ago" would let the same gap read as fine in one place
67
+ and alarming in another.
68
+
69
+ ## 0.1.24 — 2026-08-15
70
+
71
+ ### Settings: the board can now change what Tyran does
72
+
73
+ `board --serve --write` turns the dashboard's new **Settings** tab into an
74
+ editor for the two operator-owned files — `.tyran/config.yaml` and
75
+ `.tyran/policies/autonomy.yaml`. Every knob carries a sentence saying what
76
+ turning it actually does, and every policy rule shows its own recorded reason.
77
+ Until now the answer to "where do I change this?" was an editor and a memory
78
+ of what each key meant.
79
+
80
+ **Writes are off by default and per-invocation.** Without `--write` the tab
81
+ renders with every control disabled and the command that turns it on. A board
82
+ someone left running is reachable by anything on the machine, and the
83
+ difference between reading that and editing the autonomy policy through it is
84
+ the difference the flag exists to make.
85
+
86
+ **One line moves, and the comments stay.** The plan of record said the
87
+ comments were expendable because the screen could carry the explanations. That
88
+ turned out not to be necessary: `scripts/yaml-patch.mjs` rewrites the line
89
+ that owns a value rather than round-tripping the document through a
90
+ serializer, so `templates/config.yaml` keeps all 60 of its comment lines — the
91
+ only place anyone is told that bare `off` is the YAML boolean false, which is
92
+ also the value that would have silently changed meaning had this been done the
93
+ obvious way.
94
+
95
+ **The edit is proved, not trusted.** Every patch is applied, parsed back, and
96
+ compared against the document that was intended: the target holds the new
97
+ value and every other path holds exactly what it held before. Then the whole
98
+ result goes through the same `validateConfig` / `validatePolicy` that
99
+ `schema.mjs validate` runs. A locator bug cannot ship a wrong file — it can
100
+ only fail loudly, and a refused write leaves the file byte-identical.
101
+
102
+ ### Loosening a boundary is not the same click as tightening one
103
+
104
+ Found by an independent review of the above, before it shipped, and it was
105
+ worse than the review guessed. `validatePolicy` defends exactly two globs —
106
+ `hooks/**` and `.tyran/policies/**` — so the first version of this screen
107
+ would take `.claude/settings.json` from KERNEL to AUTO in one press, on a rule
108
+ whose own stated reason is *"anything that can edit it can switch every gate
109
+ off"*. So would `.tyran/STOP` (*"a loop that can clear its own stop signal has
110
+ none"*), and so would the policy `default`, and `autonomy: P1 → P3` sat in an
111
+ ordinary dropdown next to the cost profile.
112
+
113
+ Loosening now takes a second, deliberate act: the first request is refused
114
+ with the rule's own reason quoted back and a confirmation token, and the token
115
+ is **the new value itself** rather than a boolean, so nothing widens a
116
+ boundary by sending a truthy flag beside whatever value it liked. Tightening
117
+ still applies on the first click — friction on making a boundary stricter is
118
+ how you teach someone to stop making boundaries stricter.
119
+
120
+ What guards the route, stated exactly: the `Host` pin, an `Origin` check and a
121
+ required `application/json` content type close the browser paths. They do not
122
+ stop another process on the machine that can already reach loopback; nothing
123
+ served on localhost does. The flag is the control that matters there, and the
124
+ kernel invariant is what holds even when the flag is on. `docs/board.md` says
125
+ this in those words rather than claiming a sandbox.
126
+
127
+ ### Two things a fresh install could not do
128
+
129
+ Both found by the same study, both reproduced before being believed.
130
+
131
+ - **`board --dir .tyran` crashed on a repo that had been set up and never
132
+ run** — `ENOENT`, naming a temp file nobody had heard of, on the one command
133
+ the README leads with. `.tyran/state/` is created by the first initiative;
134
+ `writeAllAtomic` staged into it and never made it.
135
+ - **A scanned config carried no `limits:` block at all**, so the entire
136
+ Overnight section of the new Settings tab was seven lines of dead text on
137
+ every fresh install — the editor deliberately refuses to invent keys. It is
138
+ now written out in full at the shipped defaults, with the feature off, which
139
+ is the same inert state as omitting it. `doctor`'s `limit-telemetry-missing`
140
+ could never fire before this either, for the same reason.
141
+
142
+ ### Four findings from the independent review, fixed before merge
143
+
144
+ - **The editor only worked on two-space indentation.** `yaml-lite` recurses
145
+ with whatever indent the next line has, so a four-space `config.yaml` is
146
+ entirely legal and `validateConfig` accepts it — but the patcher assumed a
147
+ step of 2, so on such a file eleven of the fifteen controls rendered
148
+ **enabled and populated** (the page reads the parsed document) and then
149
+ failed on click with *"is not in this file"*, which was false, and whose
150
+ paired advice told the operator to add a key that was already there. The
151
+ step is now read from the file. The one step that stays fixed is a sequence
152
+ item's siblings at dash + 2, because `- ` is two characters wide and that is
153
+ what `yaml-lite` itself does.
154
+ - **A value the subset cannot spell returned 500.** `formatScalar` throws for
155
+ a newline or an invisible codepoint — ordinary rejected input, someone
156
+ pasting a model name with a stray newline — and it escaped as a server
157
+ fault, complete with a `settings write failed` line in the terminal the docs
158
+ designate as the audit trail. Now a 400, quietly.
159
+ - **The round-trip proof had no test that failed when it was deleted.** The
160
+ reviewer neutered the comparison and the suite stayed green; 2772 fuzzed
161
+ triples fired it zero times, because every wrong case is refused earlier by
162
+ the locator, the comment guard or `formatScalar`. `sameValue` is now
163
+ exported and tested directly — it is the mutable logic the guarantee rests
164
+ on — and the module says plainly that the proof is defence in depth with no
165
+ known reachable input. Two bare `assert.throws` calls gained an error class;
166
+ the missing one is what let the 500 above through.
167
+ - **A wrong number in three places.** `templates/config.yaml` is 90 lines of
168
+ which 63 are comments, not 60 of 91.
169
+
170
+ Also from the review, unprompted: a failure inside the settings renderer was
171
+ being reported as "the board server did not answer", sending the operator to
172
+ restart something that was answering perfectly well.
173
+
174
+ ### The sandbox has a Settings tab too
175
+
176
+ `site/scripts/build-sandbox.mjs` runs the real `readSettings` over the shipped
177
+ templates, so the published sample board shows the real defaults, laid out by
178
+ the code an operator's own board runs, read-only and saying which flag would
179
+ make it otherwise.
180
+
3
181
  ## 0.1.23 — 2026-08-15
4
182
 
5
183
  ### The sandbox Spend tab shows spend
package/README.md CHANGED
@@ -184,10 +184,15 @@ npx @jjanczur/tyran board --dir .tyran --serve
184
184
  ```
185
185
 
186
186
  It prints `board: serving http://127.0.0.1:4173/` — **open that URL.** The
187
- board is read-only, bound to loopback, re-rendered on every request, and it
188
- reloads itself every 30 seconds; `--port <n>` if 4173 is taken, `Ctrl-C` to
189
- stop. That command is the one place a Node version matters, because `npx` runs
190
- the scripts outside Claude Code and they need **Node ≥ 22**.
187
+ board is bound to loopback, re-rendered on every request, and it reloads itself
188
+ every 30 seconds; `--port <n>` if 4173 is taken, `Ctrl-C` to stop. That command
189
+ is the one place a Node version matters, because `npx` runs the scripts outside
190
+ Claude Code and they need **Node ≥ 22**.
191
+
192
+ Add `--write` and the **Settings** tab becomes an editor for `.tyran/config.yaml`
193
+ and the autonomy policy — every knob with a sentence explaining it, your
194
+ comments kept, and loosening a boundary behind a second deliberate press. It is
195
+ read-only without that flag.
191
196
 
192
197
  No terminal, no server: the same page is written to **`.tyran/state/board.html`**
193
198
  after every agent, so you can just open the file —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjanczur/tyran",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
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": {