tldr-experts 0.12.0 → 0.13.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,6 +1,133 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## 0.13.0 — 2026-09-08
5
+
6
+ ### Added
7
+
8
+ - **`tldrx expert rescore [<name>] [--area <a>]` — score the knowledge you already paid for.**
9
+ Its sibling `recompute` is arithmetic over the evidence rows already in `competencies.yml`;
10
+ `rescore` RE-READS `knowledge/*.md` and derives their evidence again under today's rules. It
11
+ exists because the gate fix below changes what the NEXT training run earns and can do nothing
12
+ for the files already on disk: for every expert the bug hit, `evidence:` is `[]`, so the only
13
+ other recovery is to buy the same readings a second time — **$9.47** of them in the measured
14
+ case. Like `recompute` it reads no code, spawns nothing, spends nothing, and leaves `status`
15
+ and `last_trained` exactly as it found them.
16
+ Rows are dated by the knowledge file's own `trained_at`, or by the expert's `last_trained`
17
+ when it has none — **never by the clock**, because §2.6 weighs recency and a reading taken in
18
+ August is not evidence gathered today. When neither date exists the file is skipped with that
19
+ as the reason, and so is a file that no longer validates: rescoring is a re-read under
20
+ today's rules, and keeping rows an older tldrx once accepted is the drift this refuses.
21
+ **A rescored row carries two dates, and the rescore writes itself into the ledger** — because
22
+ the workspaces this command exists to rescue are exactly the ones whose `training.jsonl`
23
+ already asserts `check.passed` with `evidence_added: 0`. Built and measured on the first cut:
24
+ a $0 rescore turned that ledger's own August date into real August-dated rows and moved the
25
+ level 0 → 1, leaving `training.jsonl` byte-identical — two files that contradict each other,
26
+ with nothing on disk saying a free re-derivation weeks later is what wrote the rows. So
27
+ `areas[].evidence[].rescored_at` is additive and optional beside `at`, and its ABSENCE keeps
28
+ the meaning every row already had: a paid training turn earned it. `at` still says when the
29
+ CLAIM was read and is still the only date the level formula weighs; `rescored_at` says when
30
+ the SCORING happened. And `training.jsonl` gains one `evidence.rescored` line per file whose
31
+ rescore actually moved something — `cost_usd: 0`, `spawned: 0`, dated when it RAN and never
32
+ backdated to match the rows, carrying `dated_at`/`dated_by` so the two clocks in one record
33
+ can never be read as one. A rescore that changes nothing writes no line: it contradicts
34
+ nothing, and a ledger that grows on every idempotent re-run is one nobody reads.
35
+
36
+ - **`scripts/merge-wave.sh` now refuses a branch that carries no review record (#192).** Every
37
+ other invariant this script protects got a mechanism — the lock (#44), the HEAD assertion, the
38
+ ref guard (#89), the unwind and orphan refusal (#116), the self-snapshot (#117). The pre-merge
39
+ review was still a paragraph, and prose loses to recency: measured over twelve maintenance
40
+ waves (2026-09-06 → 2026-09-07), **4 of the 12** pre-merge reviews found a real Important
41
+ defect the implementer then fixed before the branch merged, and the one wave that reviewed
42
+ *after* merging found one too — which then sat on `main` for ~2 hours, because once a commit is
43
+ published the only remedies are a follow-up merge or a revert and both wait for the next lock
44
+ window. That wave did not decide to skip the review; it simply did not remember at the moment
45
+ the branch was green, and nothing in the merge path could tell the difference afterwards.
46
+ So the record is now a FILE on the branch, `.review/<branch>.md`, asserted in the same preamble
47
+ block as the dirty-tree and orphan refusals: `verdict: merge` on the first line (anything else,
48
+ `verdict: fixes required` included, refuses), `reviewed-by:` naming who read it, and `against:`
49
+ naming the sha they read. A file rather than a commit trailer because it lands in the merge
50
+ commit's tree — `main` keeps answering "was this reviewed, by whom, against which diff" long
51
+ after the branch is deleted, which a trailer could not. **A stale record refuses rather than
52
+ warns**, and the refusal names both shas: a review of a different diff is exactly the hole the
53
+ honour system already allowed, and a warning would let it through. Staleness is measured as
54
+ "the code moved", not "the sha differs" — the named sha must be an ancestor of the branch head
55
+ with no path outside `.review/` changed since — because a record can only ever name the commit
56
+ the reviewer READ, and committing the record moves the head past exactly that sha, so a literal
57
+ sha-equals-head rule would be unsatisfiable by construction. A rebase does invalidate a record,
58
+ correctly: it is a different diff. The exit code is **10**, a new one: that script's table is
59
+ its own namespace with one code per condition, `2` there is already "merge conflict", and the
60
+ CLI refusal families in `src/cli/exitCodes.ts` — where 2 IS the gate refusal — do not reach a
61
+ shell script that never imports them. Every refusal prints the file path and the three
62
+ lines it wants, so a session that trips the gate never has to read the script to satisfy it.
63
+ There is **no escape hatch** — no flag, no env var — on the issue's own argument that a
64
+ documented one is a hole the moment it exists. Scoped to the MERGE PATH alone:
65
+ `scripts/release.sh` commits on `main` directly, waves nothing and names `merge-wave.sh`
66
+ nowhere (measured — `grep -n 'merge-wave' scripts/release.sh scripts/release-check.sh
67
+ docs/RELEASING.md` exits 1 with no output), so releasing is untouched and `docs/RELEASING.md`
68
+ needed no change. `AGENTS.md` §2 carries the rule and the `maintain` skill cites it rather
69
+ than restating it.
70
+
71
+ ### Fixed
72
+
73
+ - **The mutation check is asked of the developer, which can run it, instead of the reviewer,
74
+ which holds no pen.** Every stack pack's `## Checks` carried "Can each new test fail? verify:
75
+ change the line under test, re-run only that test's file … and confirm it goes red", and those
76
+ Checks are rendered verbatim into the reviewer prompt under `## Stack checks` — a hundred lines
77
+ above a Rule in that same prompt reading "You have no write tool." That was not a wording slip
78
+ in one of the two places: `REVIEWER_TOOLS` is `Read`, `Grep`, `Glob`, `Bash(git diff *)`, so the
79
+ role being asked held neither the pen the mutation needs nor a way to run a test. Measured over
80
+ a week of unattended runs on three real workspaces, hosts resolved the contradiction by hand
81
+ every time and nobody reported the check as unaskable — which is the worse outcome, because a
82
+ reviewer that cannot perform a check still answers it, from reading alone, and calls that an
83
+ answer. It is a producer's obligation, so it goes to the producer: the developer's contract now
84
+ carries it as step 5 of `## Investigate` (`MUTATION_PROOF_RULE`), naming the same instrument the
85
+ packs named — the one test file while iterating, the declared command once, at the Definition of
86
+ Done — and asking for the record it leaves. What is left in the packs is the reviewer's half,
87
+ and it is a read: *did the developer record, beside each new test, that it was seen to fail?* A
88
+ new test carrying none is a finding with a cited file. Where the record goes is the part that
89
+ had to be decided rather than assumed — the reviewer's allowance holds no `git log`, so a commit
90
+ message is a surface it cannot read, and beside the test, in the test file, is the one place
91
+ that is both the developer's to write and the reviewer's to cite. The developer prompt's bytes
92
+ change and `test/build-golden.test.ts` moves with them; the reviewer prompt's own bytes do not.
93
+ - **A role expert could never earn evidence — `--mode full` mines the run record and the domain
94
+ gate refused it** (gh #154). `roleTraining.ts` states the premise: full mode's pre-pass reads
95
+ `tldrx-work/<run>/**/{handoff,retro}.md`, "the record of how this workflow actually ran, which
96
+ IS a role's domain". `outsideDomain` then judged every one of those citations against the
97
+ `## Domain` bullets of `expert.md`, which name folders of CODE — so 100% of what the runs pass
98
+ produced was discarded as `outside domain`, in every workspace, every time.
99
+ Measured on a real workspace at 0.8.0: four role experts, `--mode full`, **$9.47 spent and one
100
+ evidence row** — and that row is a fact token, the one citation kind the gate never inspects.
101
+ And it was not fixable from the workspace: `domainPaths()` drops any single-segment bullet, so
102
+ `tldrx-work` — the only spelling the matcher would match — cannot be declared, while every
103
+ spelling that DOES register (`tldrx-work/**`, `tldrx-work/<run>`) is a literal the
104
+ no-globbing matcher can never reach. The two sets are disjoint.
105
+ Re-measured on 0.12.0 before the fix: `domainPaths()` over the five shipped role templates
106
+ still yields `.tldrx/map/**`, `.tldrx/process.yml` + `.tldrx/map/workspace.md`,
107
+ `.tldrx/conventions/shared.md`, `.tldrx/map/{repo}/gotchas.md` and `.tldrx/memory/facts.yml`,
108
+ and `pathsIntersect` is `false` against every one of them for a citation to
109
+ `tldrx-work/<run>/03-build/handoff.md` — so no role expert could earn a row from the runs
110
+ pass at 0.12.0 either.
111
+ The gate now treats the run record as in-domain for the file mined FROM it, scoped to the pass
112
+ and not to the expert's `kind:` — a light file citing a handoff is still out of domain, and
113
+ still says so.
114
+ - **Two shipped role templates declared a `## Domain` path that matched nothing at all.**
115
+ `pathsIntersect` is segment-prefix matching with no globbing, so architect's `.tldrx/map/**`
116
+ and operations' `.tldrx/map/{repo}/gotchas.md` were literal strings: even a citation to the
117
+ map itself was refused. Both are now spelled `.tldrx/map/`, which the matcher reaches; the
118
+ nuance each carried stays in the bullet's prose. Globs and `{repo}` placeholders remain
119
+ unsupported in a `## Domain` bullet — a test now refuses one in any shipped role template
120
+ rather than letting it look like it works.
121
+ - **A paid training pass that earned nothing said so nowhere durable.** The ledger recorded
122
+ `problems` only on the failure path, so a file that validated, cost $1.61 and added zero
123
+ evidence rows was written down as `check.passed` with `evidence_added: 0` and no reason beside
124
+ it — the operator's next signal being `tldrx status` telling them to train it again. The
125
+ `check.passed` record now carries its `warnings`, and the run prints `the level did not move —
126
+ $X.XX bought 0 evidence row(s)` with the reasons under it. It stays exit `0` and the file is
127
+ still kept: a warning is a way of being worth nothing, not a lie, and quarantining an honest
128
+ file would destroy the one thing that was paid for. (The sibling of #101 on the output side —
129
+ that one refuses an empty INPUT before the money; nothing asked the question after.)
130
+
4
131
  ## 0.12.0 — 2026-09-08
5
132
 
6
133
  ### Added
package/README.md CHANGED
@@ -316,6 +316,7 @@ back on the registry is 0.3.0.
316
316
 
317
317
  | Version | Date | Status | Contains |
318
318
  |---|---|---|---|
319
+ | 0.13.0 | 2026-09-08 | `beta` | evidence a role expert can actually earn, and a review that leaves a record: `--mode full`'s runs pass mines `tldrx-work/**` while the domain gate judged every citation it produced against folders of code — measured at four role experts, **$9.47 and one evidence row**, and unfixable from the workspace because the single spelling the matcher would reach is the one `domainPaths()` drops — so the gate now treats the run record as in-domain for the file mined FROM it, scoped to the pass and never to the expert's `kind:` (a light file citing a handoff is still out of domain and still says so), two shipped role templates stop declaring `.tldrx/map/**` and `.tldrx/map/{repo}/gotchas.md` paths that matched nothing at all, and a pass that validated, spent money and earned zero rows now prints `the level did not move — $X.XX bought 0 evidence row(s)` with its reasons carried into `check.passed` instead of a silent ledger; `tldrx expert rescore` recovers what was already bought for $0 by re-reading `knowledge/*.md` under today's rules, dating rows by the knowledge file's own `trained_at` and never by the clock, with `rescored_at` additive beside `at` — its ABSENCE keeping the meaning every existing row had — and one `evidence.rescored` line per file it actually moved, so a free re-derivation can never be read as a paid turn; `scripts/merge-wave.sh` refuses a branch carrying no `.review/<branch>.md` with **exit 10**, its own code because `2` in that script is already "merge conflict", a stale record refusing rather than warning and staleness measured as "the code moved" rather than "the sha differs", since committing the record moves the head past exactly the sha it names; and the mutation check moves from the reviewer, whose allowance is `Read`/`Grep`/`Glob`/`Bash(git diff *)` and holds no pen, to the developer's contract that can run it, leaving the reviewer the read it can actually perform |
319
320
  | 0.12.0 | 2026-09-08 | `beta` | records that can be attributed and spans that were actually measured: the reviewer can be pinned to its own model and effort per role (`reviewer:`) and per story stakes (`reviewer_by_stakes:`, keyed on a story's new optional `stakes:` enum), resolved field by field under `--model`/`--effort` and shipping NO opus default — because there is no evidence yet that a stronger reviewer finds more, only the record that lets the evidence accumulate: every verdict now names the model that produced it, a host review reading `basis: host-declared` off its own flags and a host that declared nothing reading `not recorded` rather than the bundle's suggestion; `run.yml` gains `created_with` and `last_written_by` beside the file format's own `version: 1`, and `agent.spawned`/`agent.result` carry `tldrx_version`, so a run that outlived an upgrade carries both ends of the range that drove it; a task row carries `duration_ms` that never travels without `duration_basis` — `spawned` is the wall clock around the sub-agent's process, `prepare-to-commit` is a ceiling that includes the host's own time — and `tldrx cost` shows a duration per attempt and a per-stage sum that names a mixed basis instead of adding two different quantities, with a pre-existing row reading `not recorded` and never `0s`; no surface prints a bare `$0.00` over work nobody metered — one implementation writes `≥ $12.40 (7 tasks unmetered)` or `not measured: 9 in-session tasks, 0 metered` across `run status`, `budget show`, the dashboard, `replay`, `run auto`, the Build handoff and every notification, and `budget.yml` gains `unmetered_tasks` and `spent_basis`; the surface a story actually changed is measured off its own diff over the range the reviewer was shown and appended as one `story.touches_widened` with `basis: "measured"` beside what was declared, advisory and never rewriting the operator's `touches:`; and a `maintain` skill encodes the maintenance circuit twelve hand-run waves actually measured — reproduce an issue on current `origin/main` before touching anything, a fresh reviewer before `merge-wave.sh` and not after, at most 3 issues and 2 implementers a cycle — pinned by a test that every command and `§N` it cites resolves |
320
321
  | 0.11.1 | 2026-09-08 | `beta` | operating a run when nobody is watching: the drive mandate now names the host's own context as the costliest instrument and tells the driver what to READ back — a sub-agent's outcome from its `result.json` and the ledger, never its transcript, each sub-agent briefed to report its turn in ten lines, and a cited file re-opened to VERIFY at a gate rather than re-read for a claim already made — paid for inside the unchanged line budgets rather than appended; `.tldrx/workspace.yml` takes one optional `notify:` block whose command is handed a `version: 1` JSON object on stdin at each moment a person is needed (an open question with its options, its recommendation and the literal `tldrx answer` line; a gate with its approve line; a finished or failed run with what its exit code's family means; a budget warning with both numbers), split to argv and never shelled, with a notifier that will not split, is not there, exits non-zero or hangs recorded as `notify.failed` instead of failing the run; `tldrx run auto --wait-answers <duration>` polls the question files and resumes when the answer lands instead of exiting 4 the moment a stage parks, and `--notify-every <duration>` sends a timer-driven heartbeat that reminds rather than reassures while a run is parked; and a new EN+ES guide page walks the whole unattended loop — host mode versus the engine, the payload keys, a dependency-free Node adapter, a first-run checklist and the four ways it silently does nothing — naming no messaging service, by the same reasoning the mandate has always given |
321
322
  | 0.11.0 | 2026-09-08 | `beta` | governance that leaves a record: every answer says who decided it and what repo it binds, an advisory contradiction check raises a question that never stops a run and states its own limit, the close and the Build handoff count decided vs not-stated; `tldrx story widen` is the sanctioned way to grow a story's surface (a done story needs `reopen --for-fix` first) and a defect no story owns is named in the handoff, the PR body and the boundary card instead of absorbed; a budget grant is a recorded number in `budget.yml` that survives every writer, `budget raise` warns or refuses against it, presets are labelled as the assumptions they are, `triage.budget_basis` says where a figure came from and `tldrx cost --stories` measures each story against the ceiling its spawn was given, honest about lower bounds |
@@ -29,7 +29,7 @@ import {
29
29
  validateRunBudget,
30
30
  wouldExceed,
31
31
  wouldExceedHostTokens
32
- } from "./chunk-zrjgpgwy.js";
32
+ } from "./chunk-fsgsn8vb.js";
33
33
  import {
34
34
  EventLog
35
35
  } from "./chunk-f1w9sy07.js";
@@ -595,12 +595,14 @@ function readEvidenceRows(input) {
595
595
  continue;
596
596
  }
597
597
  const confidence = str2(row.confidence);
598
+ const rescoredAt = str2(row.rescored_at);
598
599
  evidence.push({
599
600
  kind,
600
601
  src,
601
602
  at,
602
603
  ...row.cross === true ? { cross: true } : {},
603
- ...isEvidenceConfidence(confidence) ? { confidence } : {}
604
+ ...isEvidenceConfidence(confidence) ? { confidence } : {},
605
+ ...rescoredAt === "" ? {} : { rescored_at: rescoredAt }
604
606
  });
605
607
  }
606
608
  return { evidence, ignored: [...counts.values()] };
@@ -10,7 +10,7 @@ import {
10
10
  spentBasis,
11
11
  tallyOf,
12
12
  validateRunBudget
13
- } from "./chunk-zrjgpgwy.js";
13
+ } from "./chunk-fsgsn8vb.js";
14
14
  import {
15
15
  EventLog,
16
16
  asRunFile,
@@ -18,7 +18,7 @@ import {
18
18
  openQuestions,
19
19
  runSnapshot,
20
20
  whatIsWaiting
21
- } from "./chunk-jd48713j.js";
21
+ } from "./chunk-w9r9p155.js";
22
22
  import {
23
23
  expertsDir,
24
24
  loadExperts,
@@ -26,7 +26,7 @@ import {
26
26
  pathsIntersect,
27
27
  readExpertDomain,
28
28
  stackExpertNames
29
- } from "./chunk-zrjgpgwy.js";
29
+ } from "./chunk-fsgsn8vb.js";
30
30
  import"./chunk-f1w9sy07.js";
31
31
  import"./chunk-yvgkw0gm.js";
32
32
  import {
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  bar,
4
4
  runSnapshot
5
- } from "./chunk-jd48713j.js";
6
- import"./chunk-zrjgpgwy.js";
5
+ } from "./chunk-w9r9p155.js";
6
+ import"./chunk-fsgsn8vb.js";
7
7
  import"./chunk-f1w9sy07.js";
8
8
  import"./chunk-yvgkw0gm.js";
9
9
  import"./chunk-1knfmj6j.js";