@jjanczur/tyran 0.1.7 → 0.1.8

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.7",
14
+ "version": "0.1.8",
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.7",
3
+ "version": "0.1.8",
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,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.8 — 2026-08-08
4
+
5
+ ### The secrets gate scanned everything except what the command published
6
+
7
+ A publishing `gh` command recorded its push with no remote and no refspecs,
8
+ so the payload estimate fell back to `--all --not --remotes=<target>` —
9
+ every unpushed commit on every local branch, none of which `gh pr create`
10
+ publishes. In a checkout with many parallel worktrees that range is
11
+ permanently over the 4 MiB ceiling (field-measured five times on one
12
+ install, latest: 308 objects / 5.4 MB scanned for a command publishing
13
+ 196 KB), so PR creation was simply unavailable and agents fell back to
14
+ manual gitleaks + REST publishes outside the gate. `gh pr create` now
15
+ resolves its head positionally and hands it to `pushRange` as the refspec;
16
+ everything not positively readable — quoted spans, expansion-bearing
17
+ values, flag clusters, a bare `--head` — keeps the wide range, and a union
18
+ with an explicit `--all` never narrows. (#36)
19
+
20
+ ### A journal entry describing a filename is not a command publishing it
21
+
22
+ `journal.mjs append` carries its payload as `--data '{...}'` — the same
23
+ prose shape as `-m`, but missing from `MESSAGE_FLAGS`, so a ledger entry
24
+ merely naming a dotenv-shaped path was refused as if it published the
25
+ file. `--data` is now exempted as prose in both the flag list and
26
+ `stripMessageArguments`; a credential-shaped path OUTSIDE the quoted blob
27
+ still refuses. Known residuals (apostrophe `sq()` chains and ANSI-C
28
+ `$'…'` payloads still unstripped) are documented in the PR for a
29
+ follow-up. (#37)
30
+
31
+ ### Rule 7 binds the conductor too
32
+
33
+ The parallelism discipline read as a rule about spawned agents, leaving
34
+ the conductor's own commits in a shared checkout implicitly exempt —
35
+ measured cost: three commits on another window's branch and an `--amend`
36
+ that welded two windows' work together. A new first bullet under rule 7
37
+ makes the worktree the rule from the conductor's FIRST commit, with the
38
+ S/M triage entries cross-referencing it. (#38)
39
+
3
40
  ## 0.1.7 — 2026-08-07
4
41
 
5
42
  ### The lease protocol nobody could follow
@@ -1250,8 +1250,17 @@ function escapeRoute(cls, unsupervised) {
1250
1250
  * direction of its incompleteness is a FALSE REFUSAL, never a silent pass: a
1251
1251
  * message flag this list misses produces an over-strict gate, not a hole.
1252
1252
  * That is the only shape of enumeration this file allows.
1253
+ *
1254
+ * `--data` is here for the same reason as `-m`, and the cost of its absence
1255
+ * was measured twice on one install: `journal.mjs append ... --data '{...}'`
1256
+ * carries a JSON blob of PROSE — a decision's text, a report's summary — and
1257
+ * a journal entry merely DESCRIBING a dotenv-shaped filename ("applied the
1258
+ * migration against .env.test") was indistinguishable to this gate from a
1259
+ * command PUBLISHING that file. The refusal pushed conductors into a
1260
+ * convention of never writing certain filenames into their own ledger, which
1261
+ * is the journal failing at its one job of recording what happened.
1253
1262
  */
1254
- const MESSAGE_FLAGS = Object.freeze(['-m', '--message', '-F', '--file', '-t', '--template', '-am', '-ma']);
1263
+ const MESSAGE_FLAGS = Object.freeze(['-m', '--message', '-F', '--file', '-t', '--template', '-am', '-ma', '--data']);
1255
1264
 
1256
1265
  /**
1257
1266
  * Remove the ARGUMENT of a message-bearing option before the tokens are taken.
@@ -1271,7 +1280,7 @@ const MESSAGE_FLAGS = Object.freeze(['-m', '--message', '-F', '--file', '-t', '-
1271
1280
  */
1272
1281
  export function stripMessageArguments(command) {
1273
1282
  return String(command).replace(
1274
- /(^|\s)(-m|--message|-F|--file|-t|--template|-am|-ma)(=|\s+)("[^"]*"|'[^']*'|\S+)/g,
1283
+ /(^|\s)(-m|--message|-F|--file|-t|--template|-am|-ma|--data)(=|\s+)("[^"]*"|'[^']*'|\S+)/g,
1275
1284
  '$1',
1276
1285
  );
1277
1286
  }
@@ -662,7 +662,100 @@ export function planCommand(command, startDir) {
662
662
  triggers.push('a git push (every commit not already on the target remote is scanned)');
663
663
  }
664
664
  if (ghPublishes) {
665
- note(dir, { scanPush: true });
665
+ // `gh pr create` publishes ONE branch — the PR's head — and adds no git
666
+ // objects of its own: the head either was already pushed THROUGH this
667
+ // gate, or gh pushes it as part of creating the PR. Recording the push
668
+ // with no refs made `pushRange` fall back to `--all --not
669
+ // --remotes=<target>`, i.e. every unpushed commit on EVERY local
670
+ // branch. Measured in a checkout carrying ~10 branches for parallel
671
+ // worktrees: 310 objects / 4,550,272 bytes for that fallback against
672
+ // 97 objects / ~105 KB for the branch the PR was actually about — a
673
+ // permanent over-ceiling refusal for as long as ANY sibling worktree
674
+ // held unpushed work, about bytes the command would never publish. A
675
+ // `git fetch` cannot heal it and the refusal's own remedy ("push a
676
+ // smaller range") does not apply to a command that pushes nothing,
677
+ // which is how a gate teaches people to route around it (ADR-19).
678
+ //
679
+ // So the head ref is resolved here and handed to `pushRange`, which
680
+ // narrows the scan to what a push of that head would publish and
681
+ // already degrades to the wide range when the ref does not resolve.
682
+ // Review of the first draft found three ways it narrowed to the WRONG
683
+ // range, so every rule below is the same inversion this file keeps
684
+ // arriving at: enumerate what is positively readable, keep the wide
685
+ // range for everything else.
686
+ //
687
+ // - The subcommand is read POSITIONALLY (`gh pr create ...`), never
688
+ // from the token bag: a `--notes "closes pr 5"` on a release must
689
+ // not turn it into a PR.
690
+ // - QUOTED spans are stripped before flags are read — a `--title` or
691
+ // `--body` argument is DATA, the same doctrine as
692
+ // `stripHeredocBodies`, and the draft read a `--head` out of a
693
+ // body string. The cost: a QUOTED head value (`--head "x"`) reads
694
+ // as unparseable and keeps the wide range. Failing to narrow is
695
+ // safe.
696
+ // - Readable head spellings are enumerated: `--head x`, `--head=x`,
697
+ // `-H x`, `-Hx`, `-H=x`. A short CLUSTER carrying `H` behind other
698
+ // letters (`-dH x`; `-bHello`, where H merely starts a body value)
699
+ // cannot be read without gh's own flag table, so it keeps the wide
700
+ // range instead of defaulting to a guess.
701
+ // - `pushRefs: []` is `pushRange`'s own encoding of the WIDE range
702
+ // (`--all`): when an earlier `git push --all` or an
703
+ // unreadable-refspec push in this same line already asked for it,
704
+ // the union must not upgrade wide to narrow. Non-empty refs are
705
+ // unioned, never replaced.
706
+ let prHead = null;
707
+ const stripped = tokensOf(segment.replace(/"[^"]*"|'[^']*'/g, ' '));
708
+ const g = stripped.findIndex(isGhProgram);
709
+ if (g !== -1 && stripped[g + 1] === 'pr' && stripped[g + 2] === 'create') {
710
+ prHead = 'HEAD';
711
+ let unreadable = false;
712
+ for (let k = g + 3; k < stripped.length; k++) {
713
+ const token = stripped[k];
714
+ let value = null;
715
+ if (token === '--head' || token === '-H') {
716
+ const next = stripped[k + 1];
717
+ if (next === undefined || next.startsWith('-')) {
718
+ unreadable = true;
719
+ continue;
720
+ }
721
+ value = next;
722
+ k++;
723
+ } else if (token.startsWith('--head=')) {
724
+ value = token.slice('--head='.length);
725
+ } else if (token.startsWith('-H') && token.length > 2) {
726
+ // pflag's attached shorthand: `-Hother`, `-H=other`. H first in
727
+ // the cluster is unambiguously the head flag.
728
+ value = token[2] === '=' ? token.slice(3) : token.slice(2);
729
+ } else if (/^-[A-Za-z]+H/.test(token)) {
730
+ unreadable = true;
731
+ continue;
732
+ } else {
733
+ continue;
734
+ }
735
+ if (value === '') {
736
+ unreadable = true;
737
+ continue;
738
+ }
739
+ // A cross-fork head is `owner:branch`; the ref is the branch part.
740
+ const ref = value.includes(':') ? value.slice(value.lastIndexOf(':') + 1) : value;
741
+ // Same rule as a push refspec: a head the shell would rewrite
742
+ // cannot narrow the range.
743
+ if (isLiteralRef(ref)) prHead = ref;
744
+ else unreadable = true;
745
+ }
746
+ if (unreadable) prHead = null;
747
+ }
748
+ const existing = targets.get(dir);
749
+ const priorWide =
750
+ existing !== undefined &&
751
+ existing.scanPush === true &&
752
+ !(Array.isArray(existing.pushRefs) && existing.pushRefs.length > 0);
753
+ if (prHead !== null && !priorWide) {
754
+ const prior = existing?.pushRefs ?? [];
755
+ note(dir, { scanPush: true, pushRefs: [...new Set([...prior, prHead])] });
756
+ } else {
757
+ note(dir, { scanPush: true });
758
+ }
666
759
  triggers.push('a gh command that publishes');
667
760
  if (words.has('release') || words.has('gist')) {
668
761
  // These upload files from DISK that may be in no commit at all —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjanczur/tyran",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
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": {
@@ -119,9 +119,11 @@ open one.
119
119
 
120
120
  - **S (minutes):** small change, no architectural risk. Do it yourself,
121
121
  verify by running it, validate the repo, report in three sentences.
122
+ "Yourself" does not suspend rule 7: when the checkout may be shared with
123
+ other sessions, your own commits go through a worktree too.
122
124
  - **M (hours):** one feature or fix. Short interview if needed, mini-plan,
123
125
  implement (yourself or one implementer), review by a SEPARATE agent, tests,
124
- report.
126
+ report. The same rule-7 note as S applies to work you do by hand.
125
127
  - **L (days):** multi-story initiative. Interview, plan to acceptance (gate),
126
128
  decompose into epics and stories, team sized to the hardware ceiling, live
127
129
  ledger, sequential merge.
@@ -253,6 +255,24 @@ open one.
253
255
  sets only; a git worktree per agent; shared zones (per the manifest in
254
256
  `PLAN.md`) are APPEND-ONLY and serialized; a branch per story; rebase
255
257
  before merge.
258
+ - **This rule binds YOUR OWN commits, not only the agents you spawn.**
259
+ "S/M-sized, no subagents" is not a license to commit directly in the
260
+ main checkout: "solo" describes your sub-agent count, never how many
261
+ OTHER conductor windows share that checkout tonight, and the main
262
+ checkout is a shared zone whether or not you delegated anything.
263
+ Measured: a parallel window SWITCHED the shared checkout's branch
264
+ mid-initiative, three conductor commits landed on that window's
265
+ branch, and a later `commit --amend` (a review fix-round) welded the
266
+ two windows' work into one commit — indistinguishable from normal
267
+ history without diffing parent SHAs, recovered only via reflog plus a
268
+ six-session coordination round. So the RULE is a worktree of your
269
+ own, under a lease, from your FIRST commit — exactly what you would
270
+ require of an implementer, not only at the final publish. The
271
+ fallback, for a commit you nonetheless make directly in the main
272
+ checkout — confirm `git branch --show-current` still names the branch
273
+ you started on, immediately before committing — only NARROWS the
274
+ window: another session can still switch branches between the check
275
+ and the commit. It is a mitigation, never the substitute.
256
276
  - **A fresh worktree has no dependencies, so every validation command in
257
277
  the config fails at once.** `npm run lint`, the type check and the test
258
278
  suite all exit 127 in a new worktree, and the evidence contract then