@kurvball/ashlar 1.3.0 → 1.4.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
@@ -6,6 +6,18 @@ changesets merged since the release before it, under its version and release dat
6
6
  and patch changes; see [RELEASING.md](RELEASING.md). Versions up to 1.0.1 follow
7
7
  [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/).
8
8
 
9
+ ## 1.4.0
10
+
11
+ _Released 2026-12-04._
12
+
13
+ ### Minor Changes
14
+
15
+ - `ashlar check --since <ref>` measures the lines a change wrote, and the files it renamed, from where it left `<ref>` rather than from `main`. A pull request into a release line gives that line, `--since origin/release/1.x`, so the fixes already on the line don't read as new. The JSON output is unchanged.
16
+
17
+ ### Patch Changes
18
+
19
+ - The docs and README wear Kurvball's open-source brand: the project's mark, Kurvball's colours and type, and code on Deep Forest.
20
+
9
21
  ## 1.3.0
10
22
 
11
23
  _Released 2026-12-04._
package/README.md CHANGED
@@ -1,4 +1,9 @@
1
- # Ashlar
1
+ <h1>
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset=".github/brand/readme-dark.png">
4
+ <img alt="Ashlar" src=".github/brand/readme-light.png" width="640">
5
+ </picture>
6
+ </h1>
2
7
 
3
8
  Ashlar is the rules for designing and building software with agents. It lints a TypeScript repository and
4
9
  reads its import graph, and it keeps a baseline of each file's breaks that may only shrink: old code stays as
package/dist/check.d.ts CHANGED
@@ -35,5 +35,6 @@ export interface CheckReport {
35
35
  export interface CheckOptions {
36
36
  shrink?: boolean;
37
37
  acceptRise?: boolean;
38
+ since?: string;
38
39
  }
39
40
  export declare function check(config: Loaded, options?: CheckOptions): CheckReport;
package/dist/check.js CHANGED
@@ -78,7 +78,7 @@ export function check(config, options = {}) {
78
78
  const counts = countsOf(files);
79
79
  const before = readBaseline(config.baseline);
80
80
  let renamed = null;
81
- const renames = () => (renamed ??= renamedSince(config.root, config.include));
81
+ const renames = () => (renamed ??= renamedSince(config.root, config.include, options.since));
82
82
  let baseline = options.shrink
83
83
  ? shrunk(counts, before && carried(before, renames()))
84
84
  : (before ?? {});
@@ -88,7 +88,7 @@ export function check(config, options = {}) {
88
88
  if (options.shrink || taken.length > 0)
89
89
  writeBaseline(config.baseline, baseline);
90
90
  const risen = risesOf(counts, baseline);
91
- const changed = changedLines(config.root, config.include);
91
+ const changed = changedLines(config.root, config.include, options.since);
92
92
  const rises = [...risen, ...newBreaks(files, changed, counts, baseline, risen)];
93
93
  return {
94
94
  ok: rises.length === 0,
package/dist/cli.js CHANGED
@@ -18,7 +18,7 @@ import { dependentsOf, dependentsText } from './rehearse/dependents.js';
18
18
  import { fillText, rehearseFill } from './rehearse/fill.js';
19
19
  import { isSkill, SKILL_FILE, SKILL_WRITE_WORDS, SKILLS, skillText, writeSkill } from './skill.js';
20
20
  const FLAGS = {
21
- check: ['shrink', 'accept-rise', 'json'],
21
+ check: ['shrink', 'accept-rise', 'since', 'json'],
22
22
  affected: ['since', 'json'],
23
23
  move: ['accept-rise', 'json'],
24
24
  ledger: ['json'],
@@ -92,9 +92,13 @@ async function main(args) {
92
92
  }
93
93
  const config = await loadConfig();
94
94
  if (command === 'check') {
95
- const checked = check(config, { shrink: flags.has('shrink'), acceptRise: flags.has('accept-rise') });
95
+ const checked = check(config, {
96
+ shrink: flags.has('shrink'),
97
+ acceptRise: flags.has('accept-rise'),
98
+ since,
99
+ });
96
100
  const { warnings, ...report } = checked;
97
- print(json, { version: 1, ...report }, checkText(checked, relative(process.cwd(), config.baseline)));
101
+ print(json, { version: 1, ...report }, checkText(checked, relative(process.cwd(), config.baseline), since));
98
102
  for (const warning of warnings)
99
103
  process.stderr.write(`Warning: ${warning}\n`);
100
104
  return report.ok ? 0 : 1;
package/dist/git.d.ts CHANGED
@@ -7,8 +7,8 @@ export interface Renamed {
7
7
  from: string;
8
8
  to: string;
9
9
  }
10
- export declare function renamedSince(root: string, folders: string[]): Renamed[];
11
- export declare function changedLines(root: string, folders: string[]): ChangedLines;
10
+ export declare function renamedSince(root: string, folders: string[], since?: string): Renamed[];
11
+ export declare function changedLines(root: string, folders: string[], since?: string): ChangedLines;
12
12
  export declare function hasHead(root: string): boolean;
13
13
  export declare function knownRef(root: string, ref: string): void;
14
14
  export interface Tree {
package/dist/git.js CHANGED
@@ -32,6 +32,9 @@ function defaultBase(root) {
32
32
  return closest.base;
33
33
  return git(root, ['rev-parse', '--verify', '--quiet', 'HEAD']) === null ? null : 'HEAD';
34
34
  }
35
+ function baseOf(root, since) {
36
+ return since === undefined ? defaultBase(root) : mergeBase(root, since);
37
+ }
35
38
  export function untracked(root, folders) {
36
39
  return lines(git(root, ['ls-files', '--others', '--exclude-standard', '--', ...folders]));
37
40
  }
@@ -40,8 +43,8 @@ export function changedSince(root, ref, folders = []) {
40
43
  const changed = lines(git(root, ['diff', '--relative', '--name-only', '--no-renames', base, '--', ...folders]));
41
44
  return [...new Set([...changed, ...untracked(root, folders)])].sort();
42
45
  }
43
- export function renamedSince(root, folders) {
44
- const base = defaultBase(root);
46
+ export function renamedSince(root, folders, since) {
47
+ const base = baseOf(root, since);
45
48
  if (base === null)
46
49
  return [];
47
50
  const listed = git(root, ['diff', '--relative', '--name-status', '-M', base, '--', ...folders]);
@@ -50,9 +53,9 @@ export function renamedSince(root, folders) {
50
53
  return status.startsWith('R') && from && to ? [{ from, to }] : [];
51
54
  });
52
55
  }
53
- export function changedLines(root, folders) {
56
+ export function changedLines(root, folders, since) {
54
57
  const changed = new Map();
55
- const base = defaultBase(root);
58
+ const base = baseOf(root, since);
56
59
  if (base === null)
57
60
  return changed;
58
61
  const diff = git(root, [
package/dist/report.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { AffectedReport } from './affected.ts';
2
2
  import type { CheckReport } from './check.ts';
3
3
  import type { Moved } from './move.ts';
4
- export declare function checkText(report: CheckReport, baselineFile: string): string;
4
+ export declare function checkText(report: CheckReport, baselineFile: string, since?: string): string;
5
5
  export declare function affectedText(report: AffectedReport): string;
6
6
  export declare function movedText(moves: Moved[]): string;
package/dist/report.js CHANGED
@@ -12,13 +12,13 @@ function place(found, rule) {
12
12
  return `${at}, ${plural(found.size, 'line', 'lines')} over`;
13
13
  return found.size > 1 ? `${at}, ${plural(found.size, 'line', 'lines')}` : at;
14
14
  }
15
- function rise(report) {
15
+ function rise(report, since) {
16
16
  const fresh = report.breaks.filter((found) => found.fresh);
17
17
  const shown = fresh.length > 0 ? fresh : report.breaks;
18
18
  const where = `${report.rule} in ${report.file}`;
19
19
  const head = report.count > report.baseline
20
20
  ? `${where}: ${number.format(report.count)}, up from ${number.format(report.baseline)}`
21
- : `${where}: ${plural(report.added, 'new one', 'new ones')} on lines changed since main. None may be added, even where others went.`;
21
+ : `${where}: ${plural(report.added, 'new one', 'new ones')} on lines changed since ${since}. None may be added, even where others went.`;
22
22
  const lines = [head, ...shown.slice(0, SHOWN).map((found) => ` ${place(found, report.rule)}`)];
23
23
  if (shown.length > SHOWN)
24
24
  lines.push(` and ${number.format(shown.length - SHOWN)} more`);
@@ -43,7 +43,7 @@ function takenIn(taken) {
43
43
  function held(report) {
44
44
  return report.rules.reduce((total, rule) => total + rule.baseline, 0);
45
45
  }
46
- export function checkText(report, baselineFile) {
46
+ export function checkText(report, baselineFile, since = 'main') {
47
47
  const head = `Ashlar checked ${plural(report.files, 'file', 'files')} in ${seconds(report.seconds)}`;
48
48
  const lines = [];
49
49
  if (report.baseline === 'taken') {
@@ -71,7 +71,7 @@ export function checkText(report, baselineFile) {
71
71
  lines.push(`${moved.to} moved from ${moved.from}: \`ashlar move ${moved.from} ${moved.to}\` takes its counts with it.`);
72
72
  }
73
73
  for (const found of report.rises)
74
- lines.push('', ...rise(found));
74
+ lines.push('', ...rise(found, since));
75
75
  return `${lines.join('\n')}\n`;
76
76
  }
77
77
  export function affectedText(report) {
package/dist/usage.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const USAGE = "Usage:\n ashlar check [--shrink] [--accept-rise] [--json]\n Runs the rules and the import graph, and fails when a file's count rises above what the\n baseline holds for that file. A file the baseline doesn't name holds none.\n --shrink writes the baseline: it takes it the first time, then only lowers each file's counts.\n A file that is gone drops out, and a file git saw renamed takes its counts to its new name.\n --accept-rise takes each count that rose into the baseline, and says what it took in.\n ashlar affected [files...] [--since <ref>] [--json]\n Lists the tests that reach the files, or the files changed since <ref>, through imports,\n stylesheets, setup files and builds. A deleted file lists the tests that imported it,\n and --json lists the deleted files apart.\n ashlar move <from> <to> [<from> <to> ...] [--accept-rise] [--json]\n Moves a file's counts in the baseline to its new name, or those of every file in a folder.\n Each file keeps what it holds now, up to what the baseline held for it.\n It refuses a move that takes in new breaks, unless --accept-rise is given.\n ashlar ledger [--json]\n Lists Ashlar's ledger: each rule and each check from the import graph, what it corrected, the\n case it came from as a test, the prose it replaced and the message agents read.\n ashlar map [--json]\n Lists each feature folder in the layout: its name, its reach and its proofs, the tests in it.\n --json prints it as JSON, in the feature map's schema.\n ashlar drive <feature> [--scheme light|dark] [--json]\n ashlar drive --all [--scheme light|dark] [--json]\n Walks a feature's reach script, step by step, through the config's drive command, or through\n rehearse drive when the project has a rehearse.yaml and names none. It stops at the first step\n that fails, saying which and why. --all walks every feature's.\n ashlar onboard [--check] [--json]\n Writes the onboarding guide from the map, DECISIONS.md and .claude/rules/: what the system is, a\n page per area, and every unknown as a question routed to its owner. --check fails when the\n guide is stale or was edited by hand, and writes nothing.\n ashlar brief <paths...> [--json]\n Prints what an agent needs before it changes those files: the data rules, the rules that apply\n there, the folder rules and gotchas, the decisions, the features and the open questions. Never\n access lines, and never a secret-shaped value.\n ashlar snapshot [--json]\n Prints where things stand today: the ratchet, the map, the decisions and questions, and each\n area's recent commits. It writes nothing.\n ashlar dependents <files...> [--json]\n Lists every file that reaches each file through imports, directly or not, and the reach script\n of each feature whose folder they touch: what Rehearse reads for rehearse list --affected.\n --json prints it in Rehearse's dependents contract.\n ashlar rehearse [--json]\n Prints the blocks of rehearse.yaml Ashlar fills: each feature's reach script as a flow that\n covers its folder. --json adds each flow as Rehearse reads it.\n ashlar skill verify|onboard [--write] [--force]\n Prints a skill for agents. verify: how an agent checks its own work with the map and drive,\n and shows what it made, through the attach section the config names, if any. onboard: how an\n agent reads its brief before it changes files, and keeps what people decide.\n --write writes it into .claude/skills/<name>/SKILL.md, and --force replaces one that differs.\n\n ashlar --version\n Prints the version of Ashlar that runs.\n";
1
+ export declare const USAGE = "Usage:\n ashlar check [--shrink] [--accept-rise] [--since <ref>] [--json]\n Runs the rules and the import graph, and fails when a file's count rises above what the\n baseline holds for that file. A file the baseline doesn't name holds none.\n --shrink writes the baseline: it takes it the first time, then only lowers each file's counts.\n A file that is gone drops out, and a file git saw renamed takes its counts to its new name.\n --accept-rise takes each count that rose into the baseline, and says what it took in.\n --since <ref> measures the lines a change touched, and the files it renamed, from where it\n left <ref> rather than main: on a pull request into a release line, give that line.\n ashlar affected [files...] [--since <ref>] [--json]\n Lists the tests that reach the files, or the files changed since <ref>, through imports,\n stylesheets, setup files and builds. A deleted file lists the tests that imported it,\n and --json lists the deleted files apart.\n ashlar move <from> <to> [<from> <to> ...] [--accept-rise] [--json]\n Moves a file's counts in the baseline to its new name, or those of every file in a folder.\n Each file keeps what it holds now, up to what the baseline held for it.\n It refuses a move that takes in new breaks, unless --accept-rise is given.\n ashlar ledger [--json]\n Lists Ashlar's ledger: each rule and each check from the import graph, what it corrected, the\n case it came from as a test, the prose it replaced and the message agents read.\n ashlar map [--json]\n Lists each feature folder in the layout: its name, its reach and its proofs, the tests in it.\n --json prints it as JSON, in the feature map's schema.\n ashlar drive <feature> [--scheme light|dark] [--json]\n ashlar drive --all [--scheme light|dark] [--json]\n Walks a feature's reach script, step by step, through the config's drive command, or through\n rehearse drive when the project has a rehearse.yaml and names none. It stops at the first step\n that fails, saying which and why. --all walks every feature's.\n ashlar onboard [--check] [--json]\n Writes the onboarding guide from the map, DECISIONS.md and .claude/rules/: what the system is, a\n page per area, and every unknown as a question routed to its owner. --check fails when the\n guide is stale or was edited by hand, and writes nothing.\n ashlar brief <paths...> [--json]\n Prints what an agent needs before it changes those files: the data rules, the rules that apply\n there, the folder rules and gotchas, the decisions, the features and the open questions. Never\n access lines, and never a secret-shaped value.\n ashlar snapshot [--json]\n Prints where things stand today: the ratchet, the map, the decisions and questions, and each\n area's recent commits. It writes nothing.\n ashlar dependents <files...> [--json]\n Lists every file that reaches each file through imports, directly or not, and the reach script\n of each feature whose folder they touch: what Rehearse reads for rehearse list --affected.\n --json prints it in Rehearse's dependents contract.\n ashlar rehearse [--json]\n Prints the blocks of rehearse.yaml Ashlar fills: each feature's reach script as a flow that\n covers its folder. --json adds each flow as Rehearse reads it.\n ashlar skill verify|onboard [--write] [--force]\n Prints a skill for agents. verify: how an agent checks its own work with the map and drive,\n and shows what it made, through the attach section the config names, if any. onboard: how an\n agent reads its brief before it changes files, and keeps what people decide.\n --write writes it into .claude/skills/<name>/SKILL.md, and --force replaces one that differs.\n\n ashlar --version\n Prints the version of Ashlar that runs.\n";
package/dist/usage.js CHANGED
@@ -1,10 +1,12 @@
1
1
  export const USAGE = `Usage:
2
- ashlar check [--shrink] [--accept-rise] [--json]
2
+ ashlar check [--shrink] [--accept-rise] [--since <ref>] [--json]
3
3
  Runs the rules and the import graph, and fails when a file's count rises above what the
4
4
  baseline holds for that file. A file the baseline doesn't name holds none.
5
5
  --shrink writes the baseline: it takes it the first time, then only lowers each file's counts.
6
6
  A file that is gone drops out, and a file git saw renamed takes its counts to its new name.
7
7
  --accept-rise takes each count that rose into the baseline, and says what it took in.
8
+ --since <ref> measures the lines a change touched, and the files it renamed, from where it
9
+ left <ref> rather than main: on a pull request into a release line, give that line.
8
10
  ashlar affected [files...] [--since <ref>] [--json]
9
11
  Lists the tests that reach the files, or the files changed since <ref>, through imports,
10
12
  stylesheets, setup files and builds. A deleted file lists the tests that imported it,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kurvball/ashlar",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "The rules for building software with agents: lint rules, an import graph with a shrink-only ratchet, a feature map and onboarding for TypeScript projects.",
5
5
  "keywords": [
6
6
  "agents",