tldr-experts 0.31.1 → 0.32.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,180 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.32.0 — 2026-09-16
4
+
5
+ ### Fixed
6
+
7
+ - **A refused COMPOUND ad hoc Bash line — never the Definition of Done command itself — was
8
+ turning an ordinary red DoD into a human `blocked` (#360).** Measured on a live unattended run:
9
+ 4 of 4 refusals were the developer's own ad hoc verification line (a `dotnet format … > log
10
+ 2>&1; echo …`, a `;`-chained `find`, a piped `find … | xargs cat`, a `docker info … && echo …`
11
+ — none of them the DoD), and 2 of 5 stories blocked at attempt 1 of 2 even though each had
12
+ committed work and a DoD that went on to run and decide, each costing an operator `story
13
+ reopen` + `reject --and-continue` (22–27 minutes measured twice). The #271/#313 rule reasoned
14
+ that "the same allowance would refuse the same command again", which is true of a verbatim
15
+ re-ask but not of a compound line refused for its SHAPE: `dodRedRequeue`
16
+ (`src/core/build/reviewRound.ts`) now requeues a red DoD, like any other, when the refusal
17
+ `classifyRefusal` (`src/core/build/refusalKind.ts`) reads as `separator` (chained — `&&`, `;`,
18
+ a pipe, a redirect, a heredoc) or `undeclared` (a command no `commands:` slot grants) — an
19
+ ungranted git `verb` or `git -C` (`elsewhere`) refusal still blocks on the first attempt,
20
+ because THAT line, verbatim, would be refused again. The refusal stays on the record either
21
+ way; only the block is narrowed.
22
+ - **The developer prompt told every Bash call to run one command alone only for the Definition of
23
+ Done (#360).** `## Rules` (`src/core/build/prompts.ts`) carried the "no redirection, pipes or
24
+ chaining" sentence beside the DoD rule alone, so a developer choosing its OWN ad hoc
25
+ verification command — 4 of 4 refusals in the run above — never read it. The rule now covers
26
+ every Bash call: "one command per Bash call, run verbatim and alone … no redirection, pipes,
27
+ chaining or heredocs … a compound line is refused unread". This changes the golden developer
28
+ prompt's bytes on purpose — `test/build-golden.test.ts`'s fixtures are updated for exactly
29
+ those lines.
30
+ - **A story released from a stale dependency hold could sit `blocked` forever if the gh #298
31
+ rate-limit park landed on its own turn (#361).** `staleDependencyHold` deciding a `blocked`
32
+ row's dependency is now `done` only added the story to this pass's `pending` list and logged a
33
+ line — the story file itself stayed `blocked` until `driveStory` actually settled the attempt,
34
+ and `driveStory`'s very first act is the rate-limit park, which returns before any write when
35
+ the wall is already up from an earlier story's turn. Measured on a live unattended run
36
+ (0.31.1): a story sat `blocked` across a whole further invocation, with `gate.requested`
37
+ reporting the generic `settled by an earlier \`tldrx next\`` reason a never-touched row falls
38
+ back to, and an operator had to `story reopen` it by hand. The release is now written to the
39
+ story file (`blocked` → `todo`) the moment it is decided, so a park before the attempt leaves
40
+ the story exactly where an ordinary un-attempted `todo` row sits — picked up plainly by the
41
+ next invocation instead of re-deriving the same release from the log every time it gets that
42
+ far.
43
+ - **An oversized `permission_refused` failed the whole BUILD STAGE, not just the story, and bought
44
+ `run auto` a relaunch nobody owed (#359).** Measured on a live unattended run (0.31.1): a
45
+ developer's refused command was a ~110-line heredoc; `permission_refused` (#271, additive) is
46
+ copied verbatim and was never on the emit seam's droppable-field list
47
+ (`detail`/`recording_error`/`outputs`/the `touches_widened` path lists), so a 5474-byte refused
48
+ command alone put a real `task.done` over the §2.9 4096-byte cap, `EventLog.append` refused it,
49
+ the executor threw, and the stage failed — re-dispatching a sibling story's developer for a turn
50
+ its own attempt never spent. `permission_refused` and `budget_death` (#277, the same shape) are
51
+ now clamped in `executors/build.ts`'s `settle` — head, bounded to 1024 bytes (a quarter of the
52
+ cap, `dodOutput.ts`'s existing budget, reused rather than re-derived), plus a marker naming the
53
+ original byte count and pointing at `04-build/log/<story>.md`, which already carries the field
54
+ in full (written by `writeLog` before this event, so the pointer is true by construction). The
55
+ review log, the handoff and the blocked-story reason are unaffected — none of them carry the
56
+ event-payload cap.
57
+ - **A rate-limit `allowed_warning` parked a Build stage's whole dispatch at ANY utilization,
58
+ turning an unattended run into a human gate seven times over 53–60% of the seven-day window
59
+ (#367).** `noteRateLimit` (`src/core/facilitator/executors/build.ts`) now parks an
60
+ `allowed_warning` only at or above 90% utilization of the window that carries it (owner
61
+ decision, Slack, 2026-09-16); below the line the warning is recorded on the same
62
+ `agent.rate_limited` event (`parked_absent: "below the 90% park threshold…"`) and dispatch
63
+ continues. Any other status — a real wall, or one this repo has no reading for — still parks
64
+ unconditionally, as #298 always has. Second half: `run auto --wait-gates` (`runAuto.ts`) no
65
+ longer waits on a rate-limit-parked gate as if a person had to decide it — it reads the
66
+ park's own `resets_at` off the ledger (`src/core/run/rateLimitPark.ts`) and resumes the
67
+ stage itself once the provider's own clock has passed it (signed `run auto (rate-limit)`,
68
+ a separate actor from #231's checks-retry so the two bounds can never collide), backing off
69
+ a fixed interval when the frame stated no reset at all — but ONLY when that park explains
70
+ EVERY story the stage still has unfinished (every one a plain, never-attempted `todo`,
71
+ scoped to the CURRENT attempt's own `stage.started`): a gate also held by an independently
72
+ `blocked` story, or one whose only park is stale history from an earlier attempt, is never
73
+ auto-resumed (caught on review — `storiesCondition` collapses every unfinished story into
74
+ one `stories` id, so a park on one story is not evidence about another). `run status`'s
75
+ "held by: stories" line now says "parked by a rate-limit warning" and when it resumes,
76
+ under the same predicate, instead of reading as a decision waiting on a human.
77
+ - **A declared `tool_restore:` command never ran anywhere automatically, so the base pre-flight's
78
+ own first probed command could refuse over a missing local tool before an operator had any
79
+ evidence beyond that refusal (#363).** Measured on a live unattended run (0.31.1, .NET
80
+ workspace): the workspace declared `tool_restore: dotnet tool restore` and no `install:` at
81
+ all — only `install:` was ever auto-run, and only inside a story's own fresh worktree
82
+ (`worktreeDeps.ts`) or the Build-entry probe's throwaway worktree (`entryProbe.ts`, #254),
83
+ never in the checkout the base pre-flight itself reads — so `dotnet-ef` stayed missing there
84
+ until an operator ran `dotnet tool restore` by hand. `redBaseRefusal`
85
+ (`src/core/build/dodRunner.ts`) now runs a repo's declared `tool_restore:` once in the checkout,
86
+ before its first probed command, and refuses Build by name — nothing dispatched, nothing
87
+ charged — when that restore itself fails. `install:` is deliberately NOT added to this same
88
+ door: it already has two (a story's worktree, the entry probe's worktree), and running it a
89
+ third time, automatically, in the human's own checkout regressed an existing one during this
90
+ fix (`test/story-worktree-deps.test.ts` case (d) started reporting the wrong sentence) — see
91
+ `toolRestoreCommandFor` in `src/core/build/worktreeDeps.ts` for why that door stays closed.
92
+ - **The base pre-flight's own checkout and a story's worktree are different trees, and a green
93
+ reading from the first said nothing about it (#363).** Measured on the same live run: the base
94
+ pre-flight ran a command clean in the checkout; the identical command, on the identical base
95
+ sha, then failed inside a story's own worktree — a contract test asserting a build-time commit
96
+ id that SourceLink could not resolve there, an environment difference (a `.git` FILE, git's own
97
+ worktree convention, vs. the checkout's `.git` directory) the checkout reading cannot see by
98
+ construction. Moving the probe itself into a throwaway worktree was considered and rejected
99
+ with evidence: `dodRunner.ts`'s own "Where it runs" already documents why the checkout is
100
+ deliberate (a pristine worktree "would fail half the world's repos for want of `node_modules`
101
+ — turning this safety net into an outage"), and paying for every declared command a second time
102
+ on every run that needs a fresh measurement is a real, ongoing cost for a narrower class of gap
103
+ than that outage. Instead, absent-with-reason (AGENTS.md §7): every base-tree row in
104
+ `04-build/preflight.yml` now carries `tree: checkout`, so a reader — human or the loop itself —
105
+ cannot mistake "green on the base" for "green in the tree shape a story's own DoD actually runs
106
+ in".
107
+ - **The Build developer's own brief told it "these files are the ONLY ones you may read" —
108
+ literally, for every story whose declared `touches` were fully inlined — and a headless
109
+ developer that believed it asked a question instead of opening a file it needed and left no
110
+ diff (#364).** Measured live: story S5's `touches` had 2 files, both inlined; `## Inputs`'
111
+ preamble (`src/core/facilitator/prompt.ts`) and `## Investigate` step 1 (`src/core/build/
112
+ prompts.ts`, "They are the whole brief") both read as a hard READ ceiling rather than the
113
+ WRITE allowlist `touches` is meant to be, so the developer could not see how to reach the
114
+ port interface, command fields and sibling-test conventions its acceptance criteria needed —
115
+ $0.50, no diff, and the story sat `blocked` until an operator ran `story reopen` +
116
+ `reject --and-continue`. `preamble()` is now role-aware (`PreambleRole`, default `"reader"`
117
+ byte-identical to before): the Build developer's `## Inputs` and `## Investigate` now say
118
+ plainly that `touches` limits what it may CHANGE, never what it may READ — every other
119
+ caller (Watch, the `What` stage) is unchanged. Second half of the same defect: when the
120
+ run's `questions_policy` (§2.2) resolves the Build stage to anything but `human`, the
121
+ developer brief now carries an explicit rule — "This run is unattended: nobody answers
122
+ questions. Decide, state the assumption in your handoff, and proceed" — and a turn that
123
+ asks anyway (`questions_asked` non-empty) and leaves no diff is recorded `failure_kind:
124
+ "asked_no_diff"` (reusing #348's vocabulary) and requeued while attempts remain, the same
125
+ shape a red DoD gets, instead of a terminal `blocked` only a human could lift. Attended runs
126
+ are unchanged: the new checks are gated on `unattended` and never fire under the default
127
+ `human` policy. This changes the golden developer prompt's bytes on purpose —
128
+ `test/build-golden.test.ts`'s fixtures are updated for exactly the `## Inputs` preamble and
129
+ `## Investigate` steps 1–2.
130
+ - **A story rescued from a dead-developer block had the same gap #361 fixed for a stale
131
+ dependency release, one branch above it in the wave loop (#366).** Deciding
132
+ `blockedByFailedDeveloper(planned) !== null` — a `blocked` row whose developer never actually
133
+ ran — only added the story to this pass's `pending` list and logged a line; the story file
134
+ itself stayed `blocked` until `driveStory` settled an attempt, and `driveStory`'s very first
135
+ act is the same gh #298 rate-limit park #361 fixed for the dependency case, which returns
136
+ before any write when the wall is already up from an earlier story's turn in the same pass. A
137
+ story rescued and then parked before its own turn was left exactly where it started, `blocked`
138
+ on disk, forever. Both releases now go through one shared step, `releaseBlockedStory`
139
+ (`src/core/facilitator/executors/build.ts`), that writes `blocked` → `todo` the instant either
140
+ kind of release is decided, before the story is even offered a turn — one implementation, so a
141
+ park right after either can never undo it.
142
+
143
+ ### Changed
144
+
145
+ - **`docs/ROADMAP.md` states the project's north star and how we measure toward it (owner
146
+ decision, 2026-09-16).** One sentence, three metrics tracked on every run (human
147
+ interventions per run, predicted-vs-actual cost and time, defects the reviewer catches
148
+ before merge versus after), a measured "where we are" for 2026-09-16, and how the shipped
149
+ pieces and the still-unbuilt ones map to it.
150
+
151
+ ### Added
152
+
153
+ - **The `plan` gate refuses a story that enforces an invariant over existing data ahead of the
154
+ story that populates it (#365).** Measured on a live unattended run: S1 (wave 1) added a
155
+ database check constraint reading, in effect, "when fulfillment mode = Delivery, three columns
156
+ are NOT NULL" — and S4 (wave 2), the story that starts populating those columns, ran a wave
157
+ later. The `depends_on` graph was VALID (S4 legitimately depended on S1), so `validateWaveOrder`
158
+ saw nothing wrong; the defect was semantic, not structural — every existing Delivery fixture
159
+ violated S1's own constraint the moment S1 added it, so S1's DoD was structurally red before a
160
+ line of implementation. Two changes, `src/core/plan/planShape.ts`: (a) a new `PLAN_SHAPE_RULES`
161
+ entry tells the Plan agent a story adding an invariant over existing data lands in the same
162
+ story as, or in a wave after, the story that satisfies it — write it non-enforcing
163
+ (nullable/consistency-only) if it must land first; (b) `validatePlanShape` now scans each
164
+ story's `acceptance`/`test_plan` sentences for a short, exported enforcement-keyword set
165
+ (`ENFORCEMENT_KEYWORDS`: check constraint, not null, required, must be present, validation
166
+ rule, rejects, refuses) naming a field, and refuses the plan when a story no later in wave
167
+ order names the same field — matched case- and separator-insensitively, so `delivery_address_text`
168
+ and `DeliveryAddressText` collide — with a populate verb (`POPULATE_VERBS`: sets, populates,
169
+ writes, stores, fills, assigns) — naming both story ids, each story's own spelling, and both
170
+ sentences. This is the
171
+ cheaper substitute for re-enabling the `how` stage the owner already declined (owner decision):
172
+ a targeted static check over the plan's own text, not a whole extra paid agent turn. No
173
+ override field exists for a false positive on purpose — rewording the sentence past the
174
+ keyword set, or moving the story, is cheaper than a new plan-file escape hatch, and none of
175
+ the sibling shape rules (the wave cap's `wave_cap_reason` aside, which relaxes a different,
176
+ purely numeric rule) has one either.
177
+
3
178
  ## 0.31.1 — 2026-09-16
4
179
 
5
180
  ### Fixed
package/README.md CHANGED
@@ -335,6 +335,7 @@ back on the registry is 0.3.0.
335
335
 
336
336
  | Version | Date | Status | Contains |
337
337
  |---|---|---|---|
338
+ | 0.32.0 | 2026-09-16 | `beta` | Seven framework defects measured on the second unattended run (run #42), where every one of nine operator stalls was the framework's, not the code's. A refused compound shell line is a rework note for the developer instead of a human stop (#360); a dependency hold is re-evaluated the moment the dependency lands (#361) and a rescued story is written back to `todo` the instant the release is decided (#366); an event payload over the size cap is clamped to a bounded head instead of failing the whole build stage (#359); a headless developer is told it is unattended, that `## Inputs` is where to start and not an allowlist, and a turn that asks instead of deciding is a named `asked_no_diff` failure (#364); the rate-limit park waits for 90% of the window, not the provider's first warning at half of it (#367); the plan refuses a story that enforces an invariant on a field before the story that populates it, matching the field across spellings (#365); and the preflight restores workspace tools before its first probe and names the tree it ran in (#363, in part). Minor release: a new plan refusal, a changed park threshold and a new failure kind. |
338
339
  | 0.31.1 | 2026-09-16 | `beta` | One fix, measured on the first unattended run under 0.31.0: a seed placed at the documented `.tldrx/seeds/` location was invisible to the seed-solution detector, because the filter that drops the `what` stage's own framework inputs dropped every `.tldrx/` path, so `how` ran at full price for exactly the seeds #346 was written to skip (#358). |
339
340
  | 0.31.0 | 2026-09-16 | `beta` | Ten efficiency adjustments, ranked from a measured audit of 48 runs, so an unattended run spends less and stalls less. `how` is skipped when the seed already declares its own solution, and runs on `sonnet` when it does run (#346); `risks.md` is no longer generated (#350); `watch` follows `build`'s gate policy, so an all-auto run signs itself (#349); a Watch card's `[src:]` punctuation slip is repaired locally instead of costing a turn (#345); a fix list with zero open findings settles the round, an unreadable one holds it by name (#218); `run status` warns NO-RETRY before a retry the budget refuses (#232); a failed headless turn carries a named `failure_kind`, so the loop stops buying the same retry for every death (#348); an orphaned turn is banked as unmetered instead of a confident zero (#337); a relaunch resumes its own epic branch instead of restarting it (#347); the base-tree DoD refusal names the workspace `install:` (#343) and `run auto` names `--wait-gates` (#342). |
340
341
  | 0.30.0 | 2026-09-15 | `beta` | Seventeen changes that keep an unattended run moving instead of stranding. A cached Build refusal says so and a relaunch re-measures it (#339); a rate-limit warning is read instead of dropped, so a Build parks before the wall (#298); the plan-over-stage advisory speaks only past 2× (#302); a stage death stops recommending a retry the budget refuses (#232); a DoD command is measured twice, a fix-list finding is checked against the epic tip, and an over-long sha is refused by name (#163); a formatting slip gets one bounded repair turn (#288); five Checks stop asking the reviewer for what it can't do (#195); a Codex review no longer dies before it runs (#148); `tldrx init` probes four commands at once (#180); `tldrx ship` refuses a merged diff nobody judged (#311). Docs: the zero-touch recipe pairs `run auto` with `--wait-gates`/`--wait-answers` (#342). |
@@ -27,7 +27,7 @@ import {
27
27
  validateRunBudget,
28
28
  wouldExceed,
29
29
  wouldExceedHostTokens
30
- } from "./chunk-me0kzc6k.js";
30
+ } from "./chunk-5at77jx8.js";
31
31
  import {
32
32
  EventLog
33
33
  } from "./chunk-akemhezh.js";
@@ -12,6 +12,7 @@ import {
12
12
  asDocument,
13
13
  classifySrc,
14
14
  isRecord,
15
+ parseFrontMatter,
15
16
  parseYaml,
16
17
  readableSource,
17
18
  requireArray,
@@ -939,6 +940,15 @@ function statusOf(runDir, id) {
939
940
  return "todo";
940
941
  }
941
942
  }
943
+ function storyDependsOn(runDir, id) {
944
+ try {
945
+ const doc = parseFrontMatter(readFileSync5(join5(runDir, PLAN_DIR, "stories", `${id}.md`), "utf8")).doc;
946
+ const list = doc?.depends_on;
947
+ return Array.isArray(list) ? list.filter((x) => typeof x === "string") : [];
948
+ } catch {
949
+ return [];
950
+ }
951
+ }
942
952
  function costByStory(runDir) {
943
953
  const costs = new Map;
944
954
  const path = join5(runDir, "events.jsonl");
@@ -1441,4 +1451,4 @@ function round6(n) {
1441
1451
  return Math.round(n * 100) / 100;
1442
1452
  }
1443
1453
 
1444
- export { currentActor, nowRfc3339, spentBasis, tallyOf, DEFAULT_ON_HOST_TOKENS_EXCEED, DEFAULT_ON_GRANT_EXCEED, DEFAULT_ECONOMY, economyFor, isHostTokens, validateRunBudget, asRunBudget, expertsDir, loadExperts, readExpertDomain, pathsIntersect, stackExpertNames, WAVES_FILE, BUILD_PHASE2 as BUILD_PHASE, shortBy, remainingWork, wouldExceed, wouldExceedHostTokens, raiseGrantVerdict, REBALANCE_SOURCE, planRebalance, applyRebalance, describeRebalance, raiseCommand };
1454
+ export { currentActor, nowRfc3339, spentBasis, tallyOf, DEFAULT_ON_HOST_TOKENS_EXCEED, DEFAULT_ON_GRANT_EXCEED, DEFAULT_ECONOMY, economyFor, isHostTokens, validateRunBudget, asRunBudget, expertsDir, loadExperts, readExpertDomain, pathsIntersect, stackExpertNames, WAVES_FILE, BUILD_PHASE2 as BUILD_PHASE, buildProgress, storyDependsOn, shortBy, remainingWork, wouldExceed, wouldExceedHostTokens, raiseGrantVerdict, REBALANCE_SOURCE, planRebalance, applyRebalance, describeRebalance, raiseCommand };