@frockbot/architecture-checks 0.3.11 → 0.3.13
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/package.json +18 -18
- package/src/source-nul-bytes.test.ts +34 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/architecture-checks",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Automated checks for the constitutional rules that can be enforced mechanically.",
|
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@frockbot/application-foundation": "0.3.
|
|
13
|
-
"@frockbot/computer-core": "0.3.
|
|
14
|
-
"@frockbot/connection-core": "0.3.
|
|
15
|
-
"@frockbot/kernel-agent-loop": "0.3.
|
|
16
|
-
"@frockbot/kernel-composition": "0.3.
|
|
17
|
-
"@frockbot/kernel-contracts": "0.3.
|
|
18
|
-
"@frockbot/kernel-do": "0.3.
|
|
19
|
-
"@frockbot/plugin-applets": "0.3.
|
|
20
|
-
"@frockbot/plugin-authoring": "0.3.
|
|
21
|
-
"@frockbot/plugin-computer": "0.3.
|
|
22
|
-
"@frockbot/plugin-memory": "0.3.
|
|
23
|
-
"@frockbot/plugin-models": "0.3.
|
|
24
|
-
"@frockbot/plugin-prompt": "0.3.
|
|
25
|
-
"@frockbot/plugin-provider-foundation": "0.3.
|
|
26
|
-
"@frockbot/plugin-provider-ollama-cloud": "0.3.
|
|
27
|
-
"@frockbot/plugin-skills": "0.3.
|
|
28
|
-
"@frockbot/plugin-tools": "0.3.
|
|
12
|
+
"@frockbot/application-foundation": "0.3.13",
|
|
13
|
+
"@frockbot/computer-core": "0.3.13",
|
|
14
|
+
"@frockbot/connection-core": "0.3.13",
|
|
15
|
+
"@frockbot/kernel-agent-loop": "0.3.13",
|
|
16
|
+
"@frockbot/kernel-composition": "0.3.13",
|
|
17
|
+
"@frockbot/kernel-contracts": "0.3.13",
|
|
18
|
+
"@frockbot/kernel-do": "0.3.13",
|
|
19
|
+
"@frockbot/plugin-applets": "0.3.13",
|
|
20
|
+
"@frockbot/plugin-authoring": "0.3.13",
|
|
21
|
+
"@frockbot/plugin-computer": "0.3.13",
|
|
22
|
+
"@frockbot/plugin-memory": "0.3.13",
|
|
23
|
+
"@frockbot/plugin-models": "0.3.13",
|
|
24
|
+
"@frockbot/plugin-prompt": "0.3.13",
|
|
25
|
+
"@frockbot/plugin-provider-foundation": "0.3.13",
|
|
26
|
+
"@frockbot/plugin-provider-ollama-cloud": "0.3.13",
|
|
27
|
+
"@frockbot/plugin-skills": "0.3.13",
|
|
28
|
+
"@frockbot/plugin-tools": "0.3.13",
|
|
29
29
|
"cordis": "4.0.0-rc.8"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// A NUL byte inside a source file is invisible in an editor and harmless at
|
|
2
|
+
// runtime — a template literal holding one is just a string with a separator
|
|
3
|
+
// no name can contain. What it is not harmless to is git: a file whose first
|
|
4
|
+
// 8000 bytes contain a NUL is binary, and git has no three-way merge for a
|
|
5
|
+
// binary file. Two branches that both edit it do not conflict; one side is
|
|
6
|
+
// kept whole and the other's edits vanish, with nothing in the merge output
|
|
7
|
+
// to say so. That is how `packages/plugin-flock/src/client/index.ts` became a
|
|
8
|
+
// file every merge gambled on. Write the byte as an escape instead, so the
|
|
9
|
+
// string is identical and the file stays text.
|
|
10
|
+
import { describe, expect, test } from "bun:test";
|
|
11
|
+
import { readFileSync } from "node:fs";
|
|
12
|
+
import { join, resolve } from "node:path";
|
|
13
|
+
import { $ } from "bun";
|
|
14
|
+
|
|
15
|
+
const repoRoot = resolve(import.meta.dirname, "..", "..", "..");
|
|
16
|
+
|
|
17
|
+
describe("tracked source files are text", () => {
|
|
18
|
+
test("no source file under packages/ or apps/ contains a NUL byte", async () => {
|
|
19
|
+
const listed = await $`git -C ${repoRoot} ls-files -z packages apps`
|
|
20
|
+
.quiet()
|
|
21
|
+
.text();
|
|
22
|
+
const sources = listed
|
|
23
|
+
.split("\0")
|
|
24
|
+
.filter((path) => path.length > 0)
|
|
25
|
+
.filter((path) => /\.(ts|tsx|vue|css|md|json|jsonc|html)$/u.test(path));
|
|
26
|
+
// A sanity floor: an empty listing would make this test pass vacuously.
|
|
27
|
+
expect(sources.length).toBeGreaterThan(100);
|
|
28
|
+
|
|
29
|
+
const offenders = sources.filter((path) =>
|
|
30
|
+
readFileSync(join(repoRoot, path)).includes(0),
|
|
31
|
+
);
|
|
32
|
+
expect(offenders).toEqual([]);
|
|
33
|
+
});
|
|
34
|
+
});
|