@jjanczur/tyran 0.1.14 → 0.1.16

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.14",
14
+ "version": "0.1.16",
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.14",
3
+ "version": "0.1.16",
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,125 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.16 — 2026-08-14
4
+
5
+ ### `cat hooks/…` was refused while `Read` handed you the same bytes
6
+
7
+ Measured on the shipped 0.1.15 gate, on one file under `hooks/**`: `Read` passes,
8
+ and `cat`, `grep -n`, `wc -l` and `node --check` on that same file all **deny**.
9
+ The bytes were one tool call away in every case, so the refusal protected
10
+ nothing — and it was not consistent with itself either: `git log --oneline --
11
+ hooks/` passed all along, because a bare directory token names no file to
12
+ classify, while `wc -l` on a file inside it did not. The cost was four
13
+ interrupted tool calls in one session for the author, every one of them while
14
+ reading the gate being worked on.
15
+
16
+ The rule this release encodes instead: **the shell must not become a second
17
+ route to something the `Read` tool already refuses.** For `.env` that symmetry
18
+ is load-bearing and is untouched — `Read` denies *and* `grep` denies, because
19
+ the measured incident behind that rule is a refused `Read .env` followed by
20
+ `Bash: grep` in the very next tool call. Where `Read` is allowed, refusing the
21
+ shell buys nothing.
22
+
23
+ So on `hooks/**` and `.tyran/policies/**` — and only there — a read-only shell
24
+ command now passes. "Read-only" is matched on the **program and its flags**,
25
+ never on the program alone, because read-shaped programs have write-shaped
26
+ modes: `node --check FILE` passes and `node FILE` denies; `git log` passes and
27
+ `git log --output=FILE` denies, which was a real hole found in an earlier review
28
+ of this gate; `tail -n 5` passes and `tail -f` does not. An unrecognised flag
29
+ refuses, so the enumeration's incompleteness costs a false refusal and never a
30
+ pass. `sed` and `awk` are not on the list at all: their script argument is a
31
+ program with its own write commands, and reading it would need a second parser.
32
+ The raw command may contain none of ``< > $ ` ( ) { } &``, which is every
33
+ redirection spelling, command substitution, subshell and `&&` at once — checked
34
+ on the raw text, because the shared lexer *consumes* those characters as
35
+ separators and by the time a token exists the `>` is gone. `|` and `;` are fine,
36
+ since each composed segment still has to be an allowed reader.
37
+
38
+ What did not change: every credential shape denies for reads and writes alike;
39
+ `.claude/settings.json` and `.claude/settings.local.json` stay refused from a
40
+ shell in every mode, which is a deliberate narrowing rather than a consequence —
41
+ `Read` passes on the registry too, so the principle alone would have admitted it,
42
+ and it is the one file from which every gate is switched off at once. One line
43
+ naming a readable path *and* a secret is still refused for the secret.
44
+
45
+ That last sentence needed a second check to stay true, and review found it out.
46
+ The exemption was decided on the **finding list**, which is computed from a
47
+ *stripped* copy of the command: `stripMessageArguments` removes a message-bearing
48
+ flag together with its argument, and non-literal tokens are dropped after that.
49
+ `-t` is `git commit --template` *and* a legal flag of `diff` and `cat`, so
50
+ `diff -t .env hooks/scripts/policy-gate.mjs` left a finding list naming only the
51
+ readable path, read as "read-only command on a readable path", and was exempted —
52
+ really publishing the file. Four shapes were measured deny-on-0.1.15 →
53
+ pass-before-the-fix: `diff -t SECRET FILE`, `grep --file=SECRET FILE`,
54
+ `grep -m SECRET FILE`, and `diff ~/SECRET FILE`, the last because a leading `~`
55
+ makes the token non-literal and it is dropped entirely. The exemption is now
56
+ refused when any word of the **raw** command is credential-shaped, tested with
57
+ the same `SECRET_READ_RULES` the findings use, and the refusal names that word
58
+ rather than offering a rewrite that cannot help. This is the invariant being
59
+ repaired, not a new capability: `diff -t .env src/app.js` publishes the same
60
+ bytes and always did, because it names no protected path at all. One false
61
+ refusal comes with it, in the safe direction — `git log --grep=.env -- FILE`
62
+ loses the exemption over a word in a search pattern.
63
+
64
+ The residual floor is stated in the refusal text and in `docs/policy-gate.md`
65
+ rather than implied: matching flags bounds what a command *says*, not what the
66
+ program *does*. An allowed reader can still be pointed at another program by
67
+ configuration this gate never reads — a `diff.external` driver or a pager in git
68
+ config, a `NODE_OPTIONS` carrying `--require`, a shell function shadowing `cat`.
69
+ That is the fifth entry in `SHELL_DECLARED_MISSES`. The sixth is one step
70
+ earlier: the program table is keyed on the **basename**, which is what makes
71
+ `/bin/cat` and `cat` one entry and also makes a repo-writable `src/cat` an
72
+ allowed reader. It is declared rather than closed, because closing it would
73
+ close nothing — a script with the path already inside it needs no allowed name
74
+ at all, which is the third entry.
75
+
76
+ ## 0.1.15 — 2026-08-14
77
+
78
+ ### Fifteen questions, ten minutes, and the swarm moves
79
+
80
+ An agent that hits a product decision no longer stops and waits for you. It
81
+ raises the question — `journal.mjs ask`, one command, which mints the id under
82
+ the journal's write lock so two agents asking at the same moment get two
83
+ questions rather than one — states what it recommends and what should ship if
84
+ nobody ever answers, and takes the next ticket. The question is a `gate` whose
85
+ `kind` IS its id, `Q-<n>`: the closed event set stays at 17, the board's
86
+ waiting-on-you queue already rendered it, and `answered` was already a pass
87
+ result. What was missing was an identity and a way in.
88
+
89
+ The way in is a text file. `tyran answer render` writes `.tyran/state/ANSWERS.md`
90
+ — every open question across every initiative, the ones with no recorded default
91
+ first, because those are the only ones where saying nothing has no safe outcome.
92
+ You type under `answer:`. **Blank accepts the recorded default**, verbatim, and
93
+ still records it as a decision; `-` leaves it for next time; anything else is your
94
+ answer in your own words. `tyran answer apply` folds them back as `decision` +
95
+ `gate result: answered` pairs — decision first, so a crash leaves a visible orphan
96
+ decision rather than a closed question whose answer was never written down — then
97
+ re-renders every projection and the board. It reads the question, the default and
98
+ the ticket back out of the journal, never out of the sheet, and it is
99
+ all-or-nothing: one unparseable block and nothing at all is appended, with the
100
+ line number.
101
+
102
+ Answering a question no longer needs the conductor to be awake. `SessionStart`
103
+ records the session id in `.tyran/state/conductor.json`, so `apply --resume` can
104
+ put the swarm back on it — and refuses while that session is still alive, because
105
+ two conductors on one journal is a hazard this repo has already paid for once.
106
+
107
+ One correction found while building it. Parking an asked ticket **hid** it: the
108
+ board checks a `ticket.status` override before the ask, so our own demo fixture
109
+ showed `waiting-operator (0)` with a question open — the fixture is corrected and
110
+ the skill now forbids the override.
111
+
112
+ Also: `question`, `recommendation`, `default` and `answer` are capped at 2000
113
+ codepoints (rejected, never truncated — historical oversizes stay warnings);
114
+ `STATE.md`'s open-gates table and the SessionStart probe now carry the question
115
+ text, so a resumed conductor sees *what* it asked and not merely that it is
116
+ waiting; doctor gains `ask-open` (info) and `ask-stale` (warning, 72 h); the gate
117
+ pass set has one spelling again, exported from `project.mjs` and imported by
118
+ `overnight.mjs` instead of hand-copied; `tiers` gains an advisory `conductor`
119
+ role with a `deep` floor, so the coordinator's model is named in the one file
120
+ where model names may live — and says on stderr that no plugin can change your
121
+ own session's model.
122
+
3
123
  ## 0.1.14 — 2026-08-14
4
124
 
5
125
  ### The repository remembers what went wrong — and eventually writes it into law
package/README.md CHANGED
@@ -359,13 +359,14 @@ Published on npm as [`@jjanczur/tyran`](https://www.npmjs.com/package/@jjanczur/
359
359
  command stays `tyran` either way; only the registry name is scoped, the same
360
360
  pattern as `@angular/cli` giving you `ng`. `bin/tyran.mjs` exposes the same
361
361
  scripts the plugin's hooks and skills already call — `doctor`, `scan-repo`,
362
- `tiers`, `journal`, `schema`, `knowledge`, `board`, `overnight`, `statusline`, `stop-check`,
362
+ `tiers`, `journal`, `schema`, `knowledge`, `board`, `answer`, `overnight`, `statusline`, `stop-check`,
363
363
  `scan-control-chars`, `desc-budget` — for a shell or a CI job with no Claude
364
364
  Code session. Zero dependencies; `--help` lists them.
365
365
 
366
366
  ```bash
367
367
  npx @jjanczur/tyran doctor --hooks # is any gate installed but unable to fire?
368
368
  npx @jjanczur/tyran scan-repo --dir . # what this repo looks like, with provenance
369
+ npx @jjanczur/tyran answer render # the sheet of questions waiting on you
369
370
  ```
370
371
 
371
372
  Exit codes propagate to the digit, so a CI step reddens exactly when the
@@ -48,9 +48,21 @@ commits and anything written to disk are in English.**
48
48
  the prediction written down first, and name the mechanism. A fix for a
49
49
  failure you never reproduced cannot be shown to have worked.
50
50
  - When the PR comes back with comments, follow `pr-feedback`.
51
- 3. **Decide technical questions yourself.** Stop only for product or visual
52
- decisions, or when something would cross a boundary the handoff named —
53
- then stop and ask the conductor. "Shall I continue?" is forbidden.
51
+ 3. **Decide technical questions yourself.** "Shall I continue?" is forbidden.
52
+ A product or visual decision, or one that would cross a boundary the handoff
53
+ named, is not yours to make — and it is also not a reason to sit still.
54
+ Raise it as an operator ask, in one command, against the MAIN checkout's
55
+ journal (the handoff carries its absolute path):
56
+ `node ${CLAUDE_PLUGIN_ROOT}/scripts/journal.mjs ask <abs-journal> <init>
57
+ --actor <you> --ticket <your ticket> --question '...' --recommendation '...'
58
+ --default '...'`. State both: what you would do, and what should ship if
59
+ nobody ever answers. Then **carry on under your own default** if the story
60
+ can proceed, or report and end if it cannot. The `Q-<n>` the command prints
61
+ goes in your report. Do **not** set `ticket.status` — the ask already moves
62
+ your ticket into the board's waiting-operator lane, and an override on top
63
+ of it hides the question. Ask the **conductor**, not the operator, for a
64
+ technical unblock: a lease, a corrected premise, a scope call inside the
65
+ handoff.
54
66
  4. **Shared zones are append-only**, per the manifest. `git add` takes an
55
67
  explicit list of paths — never `-A`, never `.`; they sweep in files
56
68
  belonging to other windows, and that has already put blobs on a remote
@@ -59,6 +59,13 @@ that keeps you.
59
59
  review.
60
60
  - When you find nothing, say so plainly. Manufacturing findings to look
61
61
  thorough wastes a round and trains the conductor to discount you.
62
+ - A blocker that is really a **product or visual decision** is not a review
63
+ verdict. Raise it as an operator ask —
64
+ `node ${CLAUDE_PLUGIN_ROOT}/scripts/journal.mjs ask <abs-journal> <init>
65
+ --actor <you> --ticket <the ticket> --question '...' --recommendation
66
+ '...' --default '...'` — name the `Q-<n>` in your review, and give a
67
+ verdict on everything else. Holding a whole review open on one question
68
+ the operator has not seen is how a queue becomes a stall.
62
69
  5. **Say what you did NOT check.** Platform you did not run on, concurrency
63
70
  you did not exercise, the input class you skipped. This section is a merge
64
71
  gate, not a courtesy: the conductor resolves every item as measured,
package/bin/tyran.mjs CHANGED
@@ -88,6 +88,10 @@ export const COMMANDS = {
88
88
  'board.mjs',
89
89
  'Render the cross-initiative kanban board — BOARD.md, board.json and the board.html dashboard — from the journals under .tyran/state/.',
90
90
  ],
91
+ answer: [
92
+ 'answer.mjs',
93
+ 'Write the sheet of questions waiting on you, then fold your answers back into the journal.',
94
+ ],
91
95
  'stop-check': [
92
96
  'stop-check.mjs',
93
97
  'Check the .tyran/STOP operator brake that halts a running initiative before its next spawn or merge.',