Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 2 to 318

Compare

+21 −2 in 2 places
Lines 64–84 at 318 (were 64–69 at 2)
6464]);
6565
6666/** Files of prose, whose words are not code: Markdown, plain text, READMEs and the like. */
67+/** Data files: no code defines or uses a name in them, however big they are (abso issue 158). */
68+const DATA_EXTENSIONS = new Set(["json", "jsonc", "json5", "jsonl", "ndjson", "geojson", "csv", "tsv", "lock", "svg"]);
70+/**
71+ * Whether the definition rule passes over a file: prose, or data. Scanning a
72+ * 23,000-line JSON fixture for definitions it can't hold cost a big publish
73+ * hundreds of milliseconds, and its keys could pass for uses of code names.
74+ */
75+export function holdsNoCode(path: string): boolean {
76+ if (isProse(path)) return true;
77+ const base = path.slice(path.lastIndexOf("/") + 1).toLowerCase();
78+ const dot = base.lastIndexOf(".");
79+ return dot > 0 && DATA_EXTENSIONS.has(base.slice(dot + 1));
80+}
6782export function isProse(path: string): boolean {
6883 const base = path.slice(path.lastIndexOf("/") + 1).toLowerCase();
6984 const dot = base.lastIndexOf(".");
Lines 194–206 at 318 (were 179–187 at 2)
179194 * without its string literals and comments. A string or comment opened on
180195 * one line continues on the next.
181196 */
182−export function codeOfLines(lines: readonly string[]): string[] {
197+export function codeOfLines(lines: Iterable<string>): string[] {
198+ return [...eachCodeLine(lines)];
199+}
201+export function* eachCodeLine(lines: Iterable<string>): IterableIterator<string> {
183202 const st: ScanState = { stack: [{ kind: "code", depth: 0 }], block: false, triple: undefined };
184− return lines.map((line) => scanLine(line, st));
203+ for (const line of lines) yield scanLine(line, st);
185204}
186205
187206/** Names in some code (from codeOfLines): identifiers of three or more characters that aren't common names. */
MCP
compare on this site's /mcp
CLI
abso diff 2 318 worker/project/names.ts --json
JSON
/christopher/abso-core/compare/2..318?file=worker%2Fproject%2Fnames.ts&format=json